You should first create a backup of all your personal data. All your photos, documents and the like. After that, think on what programs are vital for your work (if it is a work computer). Make sure you either have a copy of those programs or download their installation files. Also make sure you have the serial key for the windows OS you will install. After that:
1. Restart the computer, enter BIOS setup. (usually done by pressing "del" during boot)
2. Go to the boot settings. Set the primary boot drive to your optical drive.
3. Insert Windows XP installation disk (or the recovery disk, if that is what you have).
4. Restart the machine. If it asks you whether you want to boot from the cd, make sure you do.
5. Windows setup will start. When it comes to where you want to install it, choose your system drive. You will probably have only one, so choose that one.
6. If it asks whether you want to format the drive, make sure you do. You will want to format it to make sure no files from the old installation mess up the new one.
7. Let the setup run. It will ask you for some info during the setup. It will ask you for the cd-key.
8. Once it is done, restart the computer and enter steup again. Set the primary boot drive as the HDD, not the CD anymore.
9. Done! You should now copy your backup files back to the HDD and re-install any software you need.
There may be a cath at step 5. Since Windows XP is an old OS, it may need SATA drivers to recognize your HDD to begin with. If that is the case, you will need to download those drivers on the manufacturer's site and either burn them to a cd or copy them to a floppy disk.