Windows XP?
Disk Defragment is in Start-->Programs-->Accessories-->System Tools. It takes some 5-7 hours depending on the size of your harddrive and processor speed however, so you might want to run this overnight.
Reformating is a tad trickier, because you can't do it from within Windows itself. There are a couple of ways of doing this, I prefer the "booting from the CD-Drive" method:
1) reboot your computer, but before the Windows logo shows up, hit F10 (or delete) repeatedly until you get into your BIOS (basic input-output system) settings - it's really obvious once you reach it, it looks like
this.
2) This next step honestly depends on the type of motherboard you have, but you want to find the "Boot Order" or "Boot Sequence" entry and change it to your CD-Drive (instead of C: Drive). This means that your computer will first load anything in the CD-Drive before your harddrive.
3) Open your CD-Drive and put in your windows CD in. Save the BIOS Settings and reboot your computer once again.
The next few steps are pretty straight forward, and there's an excellent tutorial on
this site. Just make sure you have all the CDs that came with your computer before you reformat it. They have important drivers for your computer's hardware that may be deleted after you reformat it.