Procedures on installing Windows XP on new HDD

My computer has been attacked by malicious threats plus some issues which I frequently encountered; I was unlucky to save my hard disk. So I need to replace it with a new one.
With the new hard disk, while I’m trying to install Windows XP in it, I keep getting errors and issues. So I wonder if there are some mistakes in setting up Windows XP. Can someone here send me a procedure on how to do it properly? Thank you.
