Back up your data with Time Machine or another backup method
Sign out of iCloud, iMessage, and any other Apple services
Restart the MacBook and enter macOS Recovery
On Apple silicon MacBook, press and hold the power button until startup options appear, then select Options
On Intel MacBook, restart and hold Command + R
Open Disk Utility
Select the internal drive and erase it
Choose APFS or Mac OS Extended as needed
Quit Disk Utility
Select Reinstall macOS
Follow the on-screen instructions to complete installation
Set up the MacBook as new or restore from backup
