How do I find my Windows product key?

To install - or reinstall - Windows you need your Windows licence number or, to use its correct name, the product key. This might be printed on a sticker somewhere on your laptop or PC, or on some documentation provided with it.
If you don’t have this, or you’ve lost it, you should be able to extract the product key from your computer using a free utility called Magical Jelly Bean Keyfinder. This can also extract keys for other software. Obviously, you’ll need to have access to a computer running the very copy of Windows you want to reinstall, or install on a different computer.  There are other utilities which can search your hard drive for keys, such as SterJo Key Finder,  Belarc Advisor, and Recover Keys, the latter of which is a paid-for alternative which can extract keys for many more applications. It costs £19.95 but you can use the discount code PCADM20RK to get 20 percent off.
You won’t be able to get the product key from a PC or laptop if its hard drive has broken, or if Windows is corrupt and you can’t get it to boot, or you can’t log in.
It's worth noting that so-called OEM product keys, such as those printed on a sticker on a Dell or HP laptop or PC, won't work with the versions of Windows you can download from Microsoft. In this case, you'd need to skip the part where you type in a product key or, if you can't, call Microsoft's support line and explain the situation. To get support, it may be most convenient to use Microsoft's website and request a call back - the page will tell you the current waiting time.
Bottom line: as long as you have a genuine key, you will be able to reinstall Windows.

How to download Windows ISO files legally

You can't download Windows until you know which version of Windows your product key is for, such as Windows 7 Home Premium 64-bit. Otherwise, your product key will be rejected if you download the wrong version.
This may be printed on the sticker, but if not, you can go to the Control Panel, then System and Security, and System. Along with other information about your PC or laptop, this will tell you precisely the version of Windows. Windows keys usually work with both 32- or 64-bit versions, but you can’t download a Professional version if your key is for a Home version.
How to download Windows ISO files

Windows 10

If you have Windows 10, you can now download the Microsoft Media Creation tool. This will walk you through the whole process of downloading the right version, and then burning it to a DVD or creating a bootable USB flash drive. 

Windows 8 / 8.1

Windows 8 is more complicated, because you can't download a Windows 8 ISO, only Windows 8.1. The confusing part is that a Windows 8 key won't work with a Windows 8.1 ISO, so if you have only a WIndows 8 key you will need to use the Windows and Office ISO downloader tool below to get Windows 8. You can then upgrade it to Windows 8.1.
If you do have a Windows 8.1 key, then you can download Windows 8.1 from Microsoft. Like Windows 10, it's done through the Media Creation Tool which gives you a choice of creating a USB or DVD, or even converting the downloaded files to a single ISO file for safekeeping.

Windows 7

You can still download Windows 7 ISO files from Microsoft's website. But you will need your product key in order to do so. And as we've said above, it can't be an OEM key from your Dell or Sony laptop. If you have only an OEM key, use the Windows and Office ISO downloader tool below
Content continues below
How to download Windows 7 ISO files
As with other versions of Windows, the download will be done via the Media Creation Tool and this is the easiest and most convenient way for most people.

Microsoft Windows and Office ISO Download Tool

You can download the free  Microsoft Windows and Office ISO Download Tool to legally obtain the ISO files for different versions of WIndows. Once installed, run it and untick the 'Expert View' box. Now choose between Windows 7, 8, 8.1 and 10 (and even 10 Insider Preview) you might have to wait a short while while the tool builds a list of the many different versions available. It will show a Select edition drop-down menu as in the image below.
After that, choose your language and 32- or 64-bit (likely to be the latter) and then click the Download button.
 How to download Windows 7 ISO files

How to install Windows from USB

At this point, and especially if you’re planning to do a fresh install and format the hard drive as part of the process, make sure you’ve backed up all your documents, music, photos, videos and other files you don’t want to lose.
Then shut down your computer and insert your USB flash drive (or DVD). Now power on the PC and it should boot from the disc or drive. If not, you’ll need to enter the BIOS and change the boot order to prioritise the DVD drive or USB drive. Here's how to enter the BIOS
When you get your computer to boot from the disc or USB drive, it should first present an option to choose the language and maybe also the exact version to install. Just make sure you pick the right settings.
Keep following the on-screen prompts to install Windows. If you're asked if you want to upgrade or do a fresh (clean) installation, choose the latter if possible. This will wipe your hard drive and is the best choice for most people as it doesn't carry across all the detritus (and potentially viruses and malware) from your old Windows installation. This improves performance and uses less disk space.
NOTE: If your hard disk is split up into several partitions you will need to choose the one on which Windows was installed previously. Be careful not to install it on a separate partition which contains any backups or personal files. 
You can often figure out which is the right one by looking at the Total Size column and also the type, since Windows has to be on a Primary partition in order to be bootable. And if you know you don't want to keep anything from your hard drive, it's safe to select each partition and delete it to completely start afresh.
Install windows from USB
For more, see How to format a hard drive