If you'd like to keep your data, obtain a second hard disk and re-install your operating system from scratch on that disk. Once the system is stable, attach your old hard disk to the computer so you can browse the files, but do not boot from it.
If you're ok with starting from scratch, simply format the disk and do a clean install of your operating system upon your new hardware.
If you'd like to retain your files and data without obtaining another hard drive, you can copy the files you'd like to keep to an external hard drive or optical media. After that, format the drive and do a clean install.
If you are transferring any old files to a new installation, you may want to scan for viruses / malware to protect yourself from any re-infection.