To close a window just click on its CLOSE (red eXit) button, located in the top-right corner of the window. If the window belongs to a program that program will terminate and then release any resources (Graphics, Devices and so on) it was using, so that other programs can then use those resources. For example: Closing a Microsoft WORD document will close that document's window, and Microsoft WORD altogether if no other document windows are open, and then release any memory that document and its window was using; therefore allowing a Paint program or Music program for example to use that now freely available memory.
Fig 1.0 Click on the CLOSE (eXit) button to close a window
Remember: A folder is a window, a file requester is a window, a program has a window and so on. So by clicking on a CLOSE button you may be closing a folder, file requester or whatever but at the end of the day you are closing a Window.
Another way to close a window is to use its FILE menu, located in the top-left corner of the window (Fig 1.1 below), and more precisely its CLOSE menu-item. Click on the FILE menu to display its menu-items and then move the mouse pointer down (or up) the menu-items, temporarily highlighting each menu-item as you move downwards (or upwards), until you reach and highlight the menu-item called CLOSE. Now click the left mouse button (left click), whilst the mouse pointer is over the word CLOSE, to close the window.
Fig 1.1 Click on the FILE menu to display its menu-items
Fig 1.2 Move the mouse pointer down the menu-items until it reaches the CLOSE menu-item and then left click
Folder windows usually have a CLOSE menu-item and File windows usually have an EXIT menu-item. In the case of File windows, it is up to the programmer what they call their CLOSE/EXIT menu-item. For example: They could call it EXIT PROGRAM or put it in a different language - it is up to them. Another example is that Microsoft Paint uses EXIT on its file menu whereas Microsoft Edge, which has not file menu, just uses the red eXit button. So do not always expect to see CLOSE or EXIT.
You can also close a window by using its taskbar icon. If you hover the mouse pointer over a window's taskbar icon in Windows 10 (no clicking) a preview pane will appear that shows you the contents of that window. This is so that you can verify, from the preview pane, what window you are going to close. In this example I am hovering the mouse pointer over a Microsoft Edge taskbar icon so that I can see what web pages (Microsoft Edge windows) are currently opened.
Fig 1.3 Hover over a window's Taskbar Icon to bring up a preview pane that displays the window's contents
To close the window, with or without previewing it first, click the right mouse button (right click) when the mouse pointer is over its taskbar icon. Doing so will bring up a context menu (Options menu) for that window (Fig 1.4 below) whereby you then need to select (left click on) the CLOSE WINDOW menu-item in order to close the window. It does not matter if the window is of a custom size, minimized or maximized because you are closing the window using its taskbar icon and not its CLOSE/EXIT button.
Fig 1.4 Click on the CLOSE WINDOW menu-item to close the window
When a window is minimized and you click on its taskbar icon that window is then either displayed as maximized or displayed at its custom size, as the front most (active) window. So if it was maximized before it was minimized, it will be maximized now. And if it was of a custom size before it was minimized, it will be of that custom size now.
If you have more than one window open of the same type (i.e. two separate Microsoft Edge windows or two Folder windows) you will be shown a preview pane for each window when you hover over their one taskbar icon. If you then hover over one of those window preview panes its CLOSE (red eXit) button will appear, and the preview pane will become lighter, whereby you can then click on that CLOSE button to close the actual window associated with that preview pane.
Fig 1.5 Hover over the M.E taskbar icon and click on a preview pane's CLOSE button to close its window
In the above example I have two Microsoft Edge windows open. If I had two Microsoft Edge tabbed windows open (two web pages displayed on separate Tabs (two mini windows) within one Microsoft Edge window), as opposed to displaying those two web pages inside two separate Microsoft Edge windows, I would first need to click on the one and only Microsoft Edge window before clicking on the red eXit button of the tabbed window I want closing (example not shown here).
If I had two web pages open in one Microsoft Edge window (as two Tabbed Windows) and two separate web pages open (each in their own Microsoft Edge window), Windows 10 would treat them as four separate tasks/jobs (four separate Microsoft Edge displays) but at the same time give them three preview panes only (because of the tabbed windows).
Fig 1.6 3 preview panes for four Microsoft Edge windows
When you click on the CLOSE button of a preview pane (Figures 1.5 and Fig 1.6 above), as described above, you are actually closing the window associated with (inside) that preview pane. So in the last example above I am closing the Microsoft Bing window (webb page) via its taskbar icon (via its preview pane). The reason I am explaining this is so that you understand better the window terminology (jargon) and have a better understanding of Tab Windows and Preview Panes.
When you eXit a preview pane (i.e. an Microsoft Edge window) that has tabbed windows within it, you will be asked if you want to close all of the tabbed windows within that one window. If you do, simply click on the CLOSE ALL button of the requester that appears (Fig 1.7 below). However: If you want to be asked all the time about closing all of the tabbed windows, make sure you untick the option ALWAYS CLOSE ALL TABS.
Fig 1.7 Click on the ALWAYS CLOSE ALL TABS button if you want subsequent tabs closed after eXit
NOTE - You cannot untick the ALWAYS CLOSE ALL TABS option and then click on the CANCEL button simply because it will not activate the always ask feature. So you must untick the option and then click on ALWAYS CLOSE ALL TABS, first time around only, in order to activate the always ask feature.
The Taskbar, Taskbar Icons and Preview Panes may need getting used to, but once you have familiarised yourself, with practise, you will probably find it easier to close windows using the methods just described.