How to reinstall macOS on your Mac - Apple Support
1. Preparation
Back up your data: While a standard reinstallation shouldn't delete your files, it is highly recommended to back up your Mac first.
Internet Connection: Ensure you have a stable broadband connection.
2. Enter Recovery Mode
The method depends on your Mac's processor:
Apple Silicon: Shut down your Mac, then press and hold the Power button until "Loading startup options" appears. Select Options, then click Continue.
Intel Processor: Turn on your Mac and immediately press and hold Command (⌘)-R until you see an Apple logo or other image.
3. Reinstall macOS
Select Reinstall macOS from the utilities window.
Click Continue and follow the onscreen instructions.
Choose your disk: If asked, select Macintosh HD.
Stay powered on: Leave your Mac plugged in and open until the installation finishes. It may restart or show a blank screen several times.
Important Troubleshooting
Disk not visible: If the installer doesn't see your disk, you may need to use Disk Utility to erase it first.
Selling your Mac: If you are giving the computer away, quit the setup assistant after installation and shut down the Mac so the new owner can set it up themselves.