That all depends on what version of OS X came on it when it was new. If it is one of the newer download only versions, Lion or Mt Lion, then you use the Online Internet Recovery system, hold down the Command + Option/Alt + r keys until you see a globe on the screen, or if it came with DVD discs for reinstalling the OS and iLife programs.
Once that is known then the process is basically the same. Repartition the drive as One partition using Disk Utility, formatted Mac Extended (Journaled) with a partition table of GUID and then reinstall the OS. If it came with DVD discs then you supply those disc to the new owner.