What to do before you sell, give away, or trade in your Mac
Factory reset of your Mac - Apple Support
If your model is from Late-2011 or later, then do this:
Internet/Network Recovery of El Capitan or Later on a Clean Disk
If possible, back up your files before proceeding.
- Restart the computer. Immediately, at or before the chime, hold down the (Command-Option-Shift-R) keys until a globe appears.
- The Utility Menu will appear in from 5-20 minutes. Be patient.
- Select Disk Utility and click on the Continue button.
- When Disk Utility loads select the target drive (out-dented entry w/type and size) from the side list.
- Click on the Erase button in Disk Utility's toolbar. A panel will drop down.
- Set the partition scheme to GUID.
- Set the Format type to APFS (SSDs, only if installing Mojave or Catalina ) or Mac OS Extended, (Journaled.)
- Provide a volume name, usually "Macintosh HD."
- Click on the Apply button, then click on the Done button when it activates.
- Quit Disk Utility and return to the Utility Menu.
- Select Install OS X and click on the Continue button.
If your model came with Yosemite or earlier, then do this:
Network Recovery of Lion Through Yosemite on a Clean Disk
Be sure you back up your files if possible.
- Restart the computer. Immediately, at or before the chime, press and hold down the Command-Option-Shift-R keys until a globe appears. Wait patiently – 5-15 minutes – until the Utility Menu appears.
- Select Disk Utility from the Utility Menu and click on the Continue button.
- After Disk Utility loads select the drive (usually, this is the out-dented entry with the mfgr.'s ID and size) from the side list. Click on the Erase button in Disk Utility’s main window toolbar. A drop-down panel will appear.
- Set the partition scheme to GUID then click. Set the Format type to Mac OS Extended (Journaled.) Click on the OK button and wait for the process to finish. Quit Disk Utility and return to the Utility Menu.
- Select Install OS X from the Utility Menu and click on the Continue button.
The above procedures will install the original version of OS X that came pre-installed from the factory.