If you are selling or donating your old Mac, then you might want to factory reset the system not only to provide the new users with a fresh start, but also to ensure your data is secured from the new owners.
Of course you might consider removing your user account from the system, and setting up a new administrative account for the new users, but the easiest and most thorough way is to fully format your system and reinstall OS X.
The first step in any factory reset of the system is to completely back it up. You can do this using Time Machine, or with a system cloning tool. Either method should result in a full copy of your computer which you can restore or migrate to a new system, if needed.
- Disable online accounts
Next be sure to disable any services that are associated with your system, as some are machine-specific and require authorization of a limited number of machines to work. For example, if you play your iTunes music on additional computers, you will need to authorize them to play any DRM-protected iTunes content. If the Mac you are parting with is one of these systems, then first disable this authorization.
- Remove any third-party hardware
If you have added any upgrades or expansions to the system, then you might consider removing them. Granted, RAM and hard drive upgrades may be difficult or unnecessary to undo, but if you have a Mac Pro with PCI express cards installed, then unless you are selling them together as a package, consider removing them from the system.
- Format and reinstall
The next step is to format your system and reinstall the original operating system software that came with it. While you can install the latest version of OS X that you purchased from the App Store, technically this is a copy licensed to you, not the new owners. Reinstalling the original version of OS X will allow the new owners to choose what version they would like to install.
To reinstall the original version of OS X if your Mac came with a gray installation and restoration DVD, insert this into the optical drive and reboot with the C key held down. Then after selecting your language choose Disk Utility from the Utilities menu. In Disk Utility, select your internal hard drive (listed above any volume names contained on it), and you should see a "Partition" tab appear. In this tab, choose "1 Partition" from the drop-down menu, and then give the partition a name, set it to be "Mac OS Extended (Journaled)," and apply the changes.
If your system did not come with a gray restoration DVD, then you will need to use Internet Recovery to restore the original version of OS X. This will access Apple's servers and download the installation tools for the correct version that came with your system. To do this, ensure you have an appropriate internet connection for use with Internet Recovery, and then reboot with the Option-Command-R keys held to force loading to Internet Recovery. Again, use Disk Utility to fully partition the internal boot drive, and then quit Disk Utility.
Once the hard drive has been formatted, you can proceed with running the OS X installer, and wait for the content to download and be set up on the system.
After the installer completes, the system will restart and show the welcome screen of the OS X setup assistant, at which point you can hold the power button to shut off the system (when it is next turned on it will start at the assistant). It is now ready for the new owners to turn on and set up, as if the Mac arrived straight from the factory.