- Restart the computer and after the chime hold down the Command and R keys until the Apple logo appears.
- When the Utility Menu appears select Disk Utility and press the Continue button.
- Then select the indented (usually, Macintosh HD) volume entry from the side list.
- Click on the Partition tab in the toolbar. You should see the partition pie chart.
- Click in the partition you wish to join with the macOS partition.
- Click on the Delete [-] button below the pie chart.
If this does what you want then you are finished. If it merely gets you an empty partition then it didn't work. You will have to erase and reformat the entire disk to fix it.
Install El Capitan or Later from Scratch
If possible back up your files.
Restart the computer. Immediately after the chime hold down the Command and R keys until the Apple logo appears. When the Utility Menu appears:
- Select Disk Utility from the Utility Menu and click on the Continue button.
- When Disk Utility loads select the volume (indented entry, usually Macintosh HD) from the Device list.
- Click on the Erase icon in Disk Utility's main window. A panel will drop down.
- Set the Format type to APFS (SSDs only) or Mac OS Extended (Journaled.)
- Click on the Apply button, then wait for the Done button to activate and click on it.
- Quit Disk Utility and return to the Utility Menu.
- Select Install OS X and click on the Continue button.