Over the past few years I have Restored the macOS on my iMac a few times using the Internet Recovery Mode. It is easy to do, very reliable, but a little time consuming. Using Internet Recovery Restore can be a life saver if nothing else is working your Troubleshooting repertoire. This article from Apple describes how to reinstall the macOS using the macOS Recovery mode. You may not need to know this right now, but you should store it away for future use.