Back up all important data to Time Machine, iCloud, or an external drive
Sign out of Apple ID, iCloud, iMessage, and FaceTime
Unpair Bluetooth devices if needed
Restart the Mac and enter macOS Recovery
On Apple silicon Macs, press and hold the power button until startup options appear, then select Options and Continue
On Intel Macs, restart and hold Command-R until Recovery appears
Open Disk Utility
Select the internal drive or Macintosh HD
Click Erase
Choose the correct format
Use APFS for most modern Macs
Use Mac OS Extended for older macOS versions if required
Confirm the erase process
Quit Disk Utility
Select Reinstall macOS from the Recovery menu
Follow the on-screen instructions to reinstall macOS
Set up the Mac as new or restore from backup
