Missing operating system can’t install new Os
Actually this is pretty easy, if you have a network connection of some sort. Wired ethernet is generally more reliable and faster, but you need the cable and possibly an ethernet adapter, depending on the model of MacBook you have.

Boot your Mac while holding the ⌘ Command and R keys. In a minute or two you will get to the macOS recovery screen which will allow you to log into WiFi (if you are not already using ethernet) and reinstall macOS.

The system will query Apple's servers over the internet and download the latest version your Mac supports. Depending on how fast your network connection is, this could take quite a while.

It will prompt you to reboot when the installation is complete. And you will have macOS installed on your Mac.

Apple has the official details here: https://support.apple.com/en-us/HT201314