Back up your Mac if you want to keep any files
Sign out of iCloud, Messages, and other accounts
On Apple silicon Mac, shut down the Mac
Press and hold the power button until startup options appear
Click Options, then click Continue
On Intel Mac, restart the Mac and hold Command + R
Open Disk Utility
Select the startup disk
Click Erase
Quit Disk Utility
Choose Reinstall macOS
Follow the on-screen instructions
Set up the Mac as new or restore from a backup
