You will need to perform an Internet Recovery or be able to boot the computer using a Snow Leopard 10.6.3 or later DVD. For the former:
Restart the computer and at the chime press and hold down the COMMAND-OPTION-R keys until you see a globe appear in the gray startup screen. This may take a little while so be patient. You need to have an internet connection for this to work - preferably using Ethernet.
After a fairly long period of time - 15 minutes or more - the recovery screen will appear. Select Disk Utility from the main menu, and click on the Continue button.
1. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
2. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
3. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
4. Set the format type to Mac OS Extended (Journaled.) Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window.
5. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
6. After formatting is done quit DU and return to the main menu. Select Install OS X from the main menu and click on the Continue button. Follow the onscreen instructions to install OS X onto the internal drive.