it's quite simple, read this before you start -
To take advantage of these features, you must press and hold the keys immediately after you press the power button that turns on your Mac, or as soon as you start restarting it. and keep them until the described behavior occurs.
Command (⌘) + R: Boot from the built-in macOS Recovery. You can also hold down Option + Command + R or Shift + Option + Command + R to start macOS Recovery over the Internet. MacOS Recovery installs different versions of macOS depending on the key combinations you press. If your Mac is protected by a hardware password, you'll be prompted for the password.
Reinstalling macOS doesn't delete data on your Mac. To start the installation, select Reinstall macOS in the utilities window in macOS Recovery Mode, then click Next and follow the on-screen instructions.
- If the installer requires you to unlock the drive, enter your Mac login password.
- If the installer does not see the disk or prompts that it cannot install the system on the computer or volume, you may need to erase the disk first.
- If the installer offers a choice between installing on a Macintosh HD or Macintosh HD-Data drive, select the Macintosh HD drive.
- Create the conditions for the installation to complete without putting your Mac to sleep, shutting it down, etc. Your Mac may restart several times and show a progress bar, and the screen may be blank for several minutes.
After the installation is complete, your Mac may restart and display the setup assistant. If you are selling, replacing, or giving away your Mac, press Command + Q to exit the assistant without completing setup. Then click Disable. When the new owner starts up the Mac, they can use their own information to complete the setup.
- Boot into macOS Recovery: Turn on your Mac, then immediately press and hold the Command (⌘) and R keys until you see the Apple logo or another image.
- If you are prompted to choose a user whose password you know, enter their administrator password.
- In the Utilities window, select Disk Utility and click Next.
- Select Macintosh HD in the sidebar of Disk Utility. Can't see your Macintosh HD drive?
- Click the Erase button on the toolbar, then enter the required information:
- Name: Macintosh HD
- Format: APFS or Mac OS Extended (Journaled) depending on Disk Utility recommendations
- Click Erase. However, if you see the Erase Volume Group button, click that button instead.
- If prompted, enter your Apple ID. Forgot your Apple ID?
- After erasing, select any other internal volume on the sidebar, and then click the delete volume button (-) on the toolbar to delete that volume. When doing these steps, ignore all internal volumes named Macintosh HD or Macintosh HD - Data, and any volumes in the External and Disk Images sections in the sidebar.
- Close Disk Utility to return to the utilities window.
- To restart from the erased drive, select Reinstall macOS in the utilities window, click Next, and follow the on-screen instructions to reinstall macOS.
If your Macintosh HD drive is not visible in Disk Utility
The built-in startup disk is the first item listed in the Disk Utility sidebar. It's called Macintosh HD, unless it's otherwise called. If you don't see it there, choose Apple menu > Shut Down, then disconnect any unnecessary devices from your Mac and try again.
If the disk still does not appear in Disk Utility, or the disk utility reports that the wiping process has failed, your Mac may require assistance from Apple Support.
The solution may be to connect this disk to another computer (another motherboard) and check its operation (this is one of the last models from which the SSD can be removed and checked organoleptically). It is also possible that the pins on the disk port are dirty or damaged, sometimes it happens.