Erase and reinstall macOS
You can restore your Mac to factory settings by erasing your Mac, then using macOS Recovery, the built-in recovery system on your Mac, to reinstall macOS.
Important: Erasing the volume removes all the information from it. Before you start, back up your essential files and information to another storage device.
Your computer must be connected to the internet. If you’re reinstalling on a Mac notebook computer, plug in the power adapter.
Start up your computer in macOS Recovery:
On a Mac with Apple silicon: Choose Apple menu > Shut Down, press and hold the power button until you see “Loading startup options,” select Options, click Continue, then follow the onscreen instructions.
On an Intel-based Mac: Choose Apple menu > Restart, then immediately press and hold Command-R.
In the Recovery app window, select Disk Utility, then click Continue.
In Disk Utility, select the volume you want to erase in the sidebar, then click Erase in the toolbar.
Type a name for the volume in the Name field, click the Format pop-up menu and choose APFS, then click Erase Volume Group.
When the erase process is complete, click Done, then choose Disk Utility > Quit Disk Utility.
In the Recovery app window, select “Reinstall macOS Big Sur,” click Continue, then follow the onscreen instructions.