If I were in your shoes, the very first thing I’d do is clone the drive, just as a safety net so you can roll back to how things are right now if everything goes sideways—you can use Acronis, Paragon, or Macrium, and they all have free versions available.
The quickest route is probably just hitting the factory reset option directly within Windows 10, which ought to wipe out any viruses you're dealing with--
1. head over to "Settings" (you'll find that icon in the bottom right corner)
2. pick "Update & Security"
3. look for "Recovery" in the menu
4. click "Get Started" under the "Reset this PC" section
5. then go ahead and select "Reset this PC"
Another way to handle it—if you want to get a bit more technical—is to mash the F9 key while the machine is booting up, before Windows actually loads.
1. Once it stops loading, choose "Troubleshoot"
2. Select "Reset Your PC"
3. When it asks, just hit "Yes"
4. You'll have to decide whether you want to just wipe the C drive or clear every single drive the system detects
5. Then there's the choice between just deleting your files or doing a full drive scrub; the latter takes a hell of a lot longer and is usually what people do when they're selling a laptop so the next guy can't dig through old data
6. Confirm it by clicking "Yes" or "OK"
I'm fairly certain both methods will keep your license intact.
But honestly, it's better to be safe than sorry and write down your activation key beforehand.
On most laptops, you can find it on a sticker underneath near the serial number.
If it isn't there, you can try pulling it with Keyfinder (
https://www.magicaljellybean.com/keyfinder/) or maybe ProduKey.
Just a heads up. Either of these paths is going to wipe your laptop completely clean, so make sure you move your documents, photos, and whatever else matters onto a thumb drive before you pull the trigger.