Back up anything that you can save for your personal files first, because they are not going to be there after the windows is re-installed. Saved links, email, last year's taxes, anything that you cannot live without. Basically, I am talking about the things that it would be worth re-infecting your machine to be able to get back.
Take a look at the programs that you have installed on the machine and write out a list of what you would like to re-install. This is a lot easier than trying to remember afterwards. Also, this is a good time to go looking for the CD's for your programs and/or try to remember where you downloaded them from.
Just pop the Windows XP CD-Rom in the drive and shut the machine off. Turn the machine back on and boot from the CD. Follow the directions on screen to install windows and take the option to reformat the partition / drive. This should set everything back as it was in the begining of your computer's life. Mind you that you will now have to re-install all of your programs.
Note: If you bought the machine from Dell or HP (or some big name), you might have a book that came with the machine and will walk you through the process of re-installing XP. Could be worth looking around for.