Mac Re-install the OS
External
Internal
Re-install with Data Deletion
El Capitan: Command + R while restarting.
Other: Command + Option + R while restarting.
OS X Utilities -> Disk Utility
First delete the partition from Disk Utilities, then "Reinstall OS X". Reinstalling without explicit deletion will upgrade and preserve the data.
Local the drive you want to erase (usually it's the only one, and it's named "Macintosh HD".
Erase "Macintosh HD"?
You can preserve the current name, and choose a format: OS X Extended (Case-sensitive, Journaled) -> Erase.
Adding a new volume to the container
Apple File System (APFS) is preferable, as it's the newest and optimized for SSDs.
Select the container disk or "APPLE SSD ... MEDIA".
Add a new volume with the + icon.
Name
APFS Case Sensitive
Installation
Then go back to OS X Utilities -> Reinstall OS X.
If I get "The recovery server could not be contacted", it is probably because the time is out of sync, so go to Utilities -> Terminal and
ntpdate -u time.apple.com
The computer must be connected to the Internet (wire or wireless): Utilities -> Network Utility.