..starcruiser..
While some ideas are fine, those better ones require forethought &/
or premeditation to have them work with longer term plans or goals.
A bootable clone of the working macOS, as full backup on boot capable
storage drive (SSD or durable 'faster spin-rate' HDD) & suited enclosure
for an external drive situation to function, either as eventual internal
replacement, or running external full system. Or a swappable backup.
A different approach may be to make a bootable installer for your Mac
on an external drive; that essentially does what the 'reinstall macOS'
could do. Create a bootable installer for macOS - Apple Support
These installers ^use Terminal commands; generally not in this way.
I've never had to use them, often a reinstall does fine, as they don't
erase user files; unless the System & Drive are wiped or damaged.
There is a possibility that a newer macOS (Mojave 10.14.6) could be
an avenue out of this; only if the internal drive is not defective.
How to download and install macOS - Apple Support
//support.apple.com/en-us/HT211683
How to reinstall macOS - Apple Support
//support.apple.com/en-us/HT204904
(..it's always a good idea to back up your Mac before trouble
& Time Machine backup can be useful, ahead of demand..)
All my macs, desktop/vintage/& portable, are backed
up with Time Machine to a basic external USB HDD.
An older G4 Mac has boot capable clones on FireWire
(LaCie FW400 250GB) external enclosure, does OK.)
When a drive has 'recovery' partitions still intact, you may be
able to start the Mac from the system drive, and choose
a recovery partition; then use that to repair the main drive.
[The OPT key is one of those, which may or not work; this
would show choices of partitions on the startup screen.]