This isn't the correct forum, you should really post your question in the iMac forum.
However, to answer your question, you should have received a (set of) installation disk(s) when you bought the iMac. You can use these to boot up the iMac, reformat the disk and reinstall a clean version of OS X. If you didn't get the installation disks then you will need to buy a retail copy of OS X.
Pop the SL disc in the Super Drive, restart the computer while holding down the Option Key and choose the Snow Leopard Install Disk. When the language comes up choose the language, then click the Utilities menu and run Disk Utility. In Disk Utility highlight the internal HD on the left, click the Erase tab and choose Mac OS Extended (Journaled) in the format radio, then click Erase. After it has erased exit Disk Utility and resume the install. This will install Snow Leopard however because you do not have iLife (iPhoto, iMovie, iWeb, & Garage Band) you will need to purchase a license of iLife to get those. Once you have OS X installed then run Software Update to ensure the machine is up to date and you're done. The complete process should take about 45 minutes or so.