You can erase all your data and reset your Mac in Recovery Mode.
The "Erase All Content and Settings" button is only available on Apple Silicon and T2 Macs running macOS Monterey or later. If your Mac doesn't have it, you can boot into Recovery Mode to factory reset your Mac. Don't forget to back up the important files before erasing your Mac.
If you're selling or giving away your Mac, you also need to cancel your AppleCare coverage and sign out of iCloud, and iMessage.
When you're ready, follow the steps below to erase your Mac and reinstall macOS:
- Shut down your Mac.
- Turn on your Mac, then immediately press and hold Command + R.
- Release the two keys when you see an Apple logo.
- If asked, select your user account and enter the administrator password.
- Click Disk Utility > Continue.
- Select Macintosh HD from the left sidebar.
- Click the Erase button in the toolbar.
- Name the drive Macintosh HD.
- Keep the file system recommended by Disk Utility.
- Click "Erase Volume Group." (If it's not shown, click Erase instead.)
- If there are other internal volumes, select one and click the ( - ) button to delete them.
- Quit Disk Utility.
- Click "Reinstall macOS" to install a new operating system.
- Follow the on-screen instruction to finish the installation.
- When your Mac restarts to a setup assistant, you can press Command + Q to quit it and click Shut Down to close your Mac so that the new user can start up and use their own information to set up the Mac.
If you can't erase your startup disk, try the solutions in this guide: [Fixed] Disk Utility Won't Let You Erase Hard Drives