There are no license keys to keep track of for macOS.
There are several ways to go about this, but I almost always create a USB installer, boot from that, start Disk Utility and format the drive, and then do a fresh install. There are instructions here:
You can use a USB flash drive or other secondary volume as a startup disk from which to install the Mac operating system. These steps are primarily for system administrators and other experienced users who are familiar with entering commands in Terminal.
support.apple.com
Do NOT reinstall any “cleaner” apps after the fresh OS install!
You can leave your internal drive untouched, and chose to not mount it, so you can always go back to booting from it if you need to for whatever reason.
If you need detailed instructions for each step, feel free to ask.