Cannot reinstall macOS on corrupted drive
This question is one we get often. If your Mac can’t boot itself to internet recovery, you need to bring a bootable external OS to your Mac to fix it.
Your Mac could run in target mode and you download the installer from another Mac or use another Mac or person to make you a new installer.
Apple documents these steps very well. All you have to do is choose what OS you want to reinstall over your existing to see if the data is still intact or if you just want to erase and set up new.

https://support.apple.com/en-us/HT204267

You will have to know how to examine the install logs or make a second installer. Either your drive is broken and needs erase and repair or your installer is broken. Hard to tell without hands on and experience. It’s easy to repeat the install with a known good installer. Then the chances both installers fail is low and you’ll know your Mac needs extra steps and attention.

https://support.apple.com/en-us/HT210905 (has steps to repair a disk)
https://support.apple.com/en-us/HT204904 (has steps to erase the disk and reinstall)