You do this either with a Mountain Lion install disc or drive, which you have to make yourself, or from the Recovery System. For the Recovery System, you reboot while holding down command-R. This boots from a (hidden) recovery partition that is on your hard drive; then you access Disk Utility and do your formatting that way. The Recovery system can do a new install of Mountain Lion from the internet from apple once you have reformatted your drive. Or you can make a ML installer disk from the installer files that you download for future reference.
Here's a page about Recovery mode: OS X: About OS X Recovery
and here's how to make your own ML installer disk: How to Burn OS X Mountain Lion to a DVD or USB Flash Drive..
BTW, you could have figured out all this yourself with a google search.