It would help if you has stated the year and model Mac you have. It sounds as if you accidentally erased your hard drive for some reason. Have you tried by using the Internet Recovery Mode? (Press Command + Option + R at startup. Be sure that you are physically connected to the internet via an Ethernet cable. If the download begins, do not otherwise use the internet during the download process, which can take up to an hour, more or less. Then the installation may take an additional 45 minutes more or less, with some restarts. If this process works, it will install the original operating system your Mac came with. Any upgrades will have to be subsequently installed. For that, be sure to use Safari, not Firefox. Do not use Wi-Fi for any of these downloads as corruption often occurs.