When you are planning on selling or gifting your Mac to someone, you need to erase the data on your Mac. so you typically work to reset the Mac.
Go to the Apple menu and select the Restart option. Wait patiently for your Mac to shut down and then begin the startup procedure. During the restart process, before moving onto the login screen, your computer will show a gray slate screen. Hold down both the Command key and the R key when you see gray.
This should pop you over to the Utilities, where you can make various important and potentially dangerous changes. Select Disk Utility. Select it and then click on the Erase tab. Next, head over to the Format option and set it to Mac OS Extended. Again select Erase. This may take some time. Once finished, go to the Disk Utility menu and select Quit Disk Utility.
Now you’ve erased everything that made your Mac special. Once you have Igor quit out of Disk Utility, you should see an option to Reinstall your current MacOS. Select that reinstall option, confirm that you really want to do it, and proceed. You may have to click through a few confirmations before the installation is ready to begin.
Also, when you reinstall MacOS, you will see a setup assistant start with basic questions about your region and so on. If you are selling or giving your Mac away, you will want to leave the setup assistant untouched. Instead, hold down the Command and Q keys, and they select Shut Down to turn the Mac off but leave the setup assistant waiting for next time.