Easiest way is to use the Windows installation DVD, wipe the hard drive, then reinstall Windows. After you format the drive, you need to reinstall Windows and all your applications.
I believe Windows 10 (and maybe 8) have the ability to restore your PC to factory settings, but it's not the same as reformatting.