Mac Re-install the OS
External
Internal
Re-install with Data Deletion
High Sierra, El Capitan: Command ⌘ + R while restarting.
Catalina, Other: Command ⌘ + Option ⌥ + R while restarting. If that leads to a wireless network setup and a "spinning globe" that doesn't end, try Command ⌘ + R.
OS X Utilities -> Disk Utility
Reinstalling without explicit deletion of the partition will upgrade and preserve the data.
First delete the partition from Disk Utilities.
macOS Utilities → Disk Utility → Select Internal → <Partition Name> from the left tab. Usually the partition is named "Macintosh HD".
The partition may not be mounted, and it should be mounted with the "Mount" Disk Utility option.
Erase → Specify the new name and the format: APFS (Case-insensitive, Encrypted).
⚠️ It is important to choose "case insensitive", applications may have problems running on a case sensitive filesystem (Microsoft Word)
⚠️ Big Sur does not allow installing on encrypted filesystems, so DO NOT choose Encrypted. The option to encrypt the disk will be given later during installation.
It is OK to leave the name as it is "Macintosh HD", this will be also the name of the new partition → Erase. The process should end with a message similar to "Erasing "<Old Partition Name> and creating "<New Partition Name>" → Done.
Leave the partition mounted, otherwise the Install OS utility won't find any disk to install on.
Then go back to macOS Utilities and install.
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 Insensitive
⚠️ It is important to choose "case insensitive", applications may have problems running on a case sensitive filesystem (Microsoft Word).
Installation
Then go back to OS X Utilities -> Reinstall OS X.
The computer must be connected to the Internet (wire or wireless): Utilities -> Network Utility.
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
"Reinstall OS X".
Select the drive -> Install.