This article will show you the steps to reinstall Mac OS X. This works for macOS 10.7 (Lion) and later versions.
1. Turn the Mac on and immediately press down the Command + R keys. The keys must be pressed before the grey screen appears. Hold them down until the Apple logo displays on the screen.
2. MacOS Utilities will open.
3. If you need to wipe the system clean, select Disk Utility. Select Macintosh HD on the left and click Erase at the top. A window will display prompting you to select a format and name the drive. If you have MacOS 10.12 (Sierra) or earlier, select Mac OS Extended Journaled. If it is 10.13 (High Sierra) or later, select APFS and click Erase. The drive will be erased and all data on it will be lost, this action cannot be undone. If you need to keep your data you can skip this step and go to step 4.
4. Close the Disk Utility window to return to MacOS Utilities. Click the Wi-Fi icon at the top right and make sure you’re connected to your internet and click Reinstall MacOS.
5. Follow the prompts to reinstall MacOS. Make sure to select the same drive that you erased before if it asks what drive you want to install to. Once the installation begins the process will take some time to complete. Keep your computer plugged in to ensure it doesn’t shut down and interrupt the install.
6. Once the installation is finished your system will restart.