My instructions are for doing a clean reinstall on the computer, not prepare it for sale. You needed to repartition the entire drive and install the original OS that came with the computer. Whoever has the computer can do the same thing, but they will need either a bootable installer or, if the computer came with Lion or later pre-installed, they will need to perform an Internet Recovery as follows. You need to remove the computer from your list of registered hardware so the new owner can register it under his/her name.
Install Mavericks, Lion/Mountain Lion on a New HDD/SDD
Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
Boot to the Internet Recovery HD:
Restart the computer and after the chime press and hold down the COMMAND-OPTION- R keys until a globe appears on the screen. Wait patiently - 15-20 minutes - until the Recovery main menu appears.
Partition and Format the hard drive:
1. Select Disk Utility from the main menu and click on the Continue button.
2. After DU loads select your external 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.
3. 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. Quit DU and return to the main menu.
Reinstall Lion/Mountain Lion. Mavericks: Select Reinstall Lion/Mountain Lion, Mavericks and click on the Install button. Be sure to select the correct drive to use if you have more than one.
Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
This will install the software that was pre-installed when new, so the new owner can purchase his own upgrade from the App Store using his own Apple ID.