first it is important to know that formatting is the last thing to do!
you may update your anti-virus to remove the viruses!
if you understand the risks and still wants to format your system,
You need to put in your Windows CD and select to format.
Place the CD in the CD drive.
Restart the computer
Press F12 to enter the boot menu
Select to boot from CD by pressing any key when promted.
Select to install Windows.
You will get a partition Window asking you to delete partitions, delete all the partitions and select to format.
Formatting will remove all the data on your machine. After the format you can then select to install a new operating system onto the machine.