When you minimize a window in macOS, it goes to the right edge of your Dock by default. If you’d rather it minimize to the app’s icon, like Windows’ taskbar does, you can alter this behavior in System Preferences.
Minimizing apps to the right edge of the dock is fine, but it can quickly become crowded with minimized windows.
To make applications minimize to their Dock icon, first open System Preferences and click “Dock”.
On the Dock preferences, check the box next to “Minimize windows into application icon”.
Now, every time you minimize an application window, it will shrink into the Dock app icon. If you want to restore any of your windows, right-click on the app icon and select it from the context menu.
If you find you prefer the old method of minimizing windows, then go back and uncheck that box and the behavior will revert to the default.