You can reinstall the operating system using the Internet Recovery Mode. On startup, press:
- Shift + Option + Command + R keys install the OS that originally came with the Mac.
- Option + Command + R keys to install the latest OS that is compatible with your Mac.
- You need to have the Mac connected to the internet. Do not use Wi-Fi as it is too slow and the downloaded files are likely to get corrupted. Use the wired Ethernet connection.