Back up any files you want to keep
Sign out of iCloud
Sign out of Messages
Sign out of Music and TV
Unpair Bluetooth devices
Restart the Mac in Recovery mode
Open Disk Utility
Erase the startup disk
Quit Disk Utility
Choose Reinstall macOS
Follow the on-screen steps
If selling or giving away the Mac, leave it at the setup screen after installation
