How did you try to delete it? You can't delete the operating system without rendering your computer useless as you have discovered.
Without taking it somewhere, your only hope is that Internet Recovery will connect.
Restart your Mac and hold down cmd-opt-r.
I spinning Globe should appear where the Apple normally does. It may ask you to connect to a network. Choose a WiFi network or plug in an Ethernet cable to get to the Internet.
If you get a failure code, then you can try restarting your Modem and Router.
If you get into Internet Recovery, you can Reinstall macOS.