It depends on if you have a recovery drive, set of recovery discs, or OS disc.
(All this assuming you have backed up the data you want backed up)
If you have the OS disc, boot it in and boot to it. Just say you want to do a clean install (wipe everything) and eventually it will prompt for a key.
With a Recovery Drive (usb) or a set of Recovery Discs, boot to which ever and follow the prompts, with a usb it will go through on its own, with discs it will ask to put in disc 1 2 3 etc.
If you do not have any of these fear not. If you have some extra dvds or a 32GB flash drive or higher you can make a recovery drive. Just plug whatever you want in, and search for "Recovery" or "Create Recovery"
You should see something like create a recovery drive/partition. Just go through that for whichever device you are using and then follow the previous directions
-Thomas
-Certified Computer Technician