Back up any important files to an external drive or cloud storage
Sign out of iCloud
Sign out of iMessage
Sign out of FaceTime
Deauthorize the Mac in Music or iTunes if needed
Restart the MacBook Pro
Hold Command and R immediately after pressing the power button
Release the keys when the Apple logo or a spinning globe appears
Select Disk Utility from macOS Utilities
Choose the internal startup disk
Click Erase
Select Mac OS Extended Journaled or APFS if available
Name the disk Macintosh HD
Click Erase
Quit Disk Utility
Select Reinstall macOS from macOS Utilities
Follow the on-screen instructions
Connect to Wi-Fi if prompted
Complete the installation
Leave the Mac at the setup screen if you are selling or giving it away
Shut down the Mac if you want the new owner to set it up
