What you're reffering to is something known as a reformat. I'll presume you already have an operating system installed on your HDD (HardDiskDrive) otherwise you wouldn't really be taking anything off it.
First off, what you do is, transfer all the data from the HDD that you need such as important documents and save them onto an external HDD or CDs. Once this is done, with your computer/laptop, look for the "Product recovery" or "System recovery" CD; should have come in the box that your pc or laptop was in when you bought it. Alternatively, you might have an OS (Operating System) CD and you can use this instead.NOTE: IF YOU ARE USING THE OS CD YOU WON'T HAVE THE DRIVERS FOR YOUR PC OR LAPTOP READILY AVAILABLE AS THEY WOULD MOST LIKELY BE ON YOUR PRODUCT RECOVERY CD. POST HERE IF YOU DON'T HAVE IT BUT IF YOU DO, MAKE SURE TO CHECK THAT YOUR PRODUCT RECOVERY CD DOES HAVE THE DRIVERS ON IT Drivers are the things that you need to install to get your hardware working at full capacity or, in some cases, working at all.
Once you have sorted that all out, put the CD in your system and reboot your computer. Make sure to go into the BIOS (this is done at the beginning when you start and it says to press F*) and change it so that it boots from CD and not from the HDD. Don't fiddle with the BIOS too much, just change it to boot from CD. Alternatively, some Computers boot from CD before they boot from HDD anyways, so if you leave t first and check if it loads the CD you won't have to fiddle with anything. You will know that it works if it loads a screen different to what you normally see
Once the CD is running, just follow the on-screen instructions and it will take you through the whole process.
Best of luck!