Well, maybe you could use a soft power switch circuit, and put a voltage supervisor chip down to turn it off if voltage goes low.
If using a microcontroller, you could use low power sleep modes.
Some have a Brown Out Detector to reset the chip. On boot up, you can look for a BOR status bit; if set, you know something went wrong and can go to deepest sleep mode.
Alternatively you could use an ADC to sense the battery voltage every once in a while and go to deepest sleep if it’s too low. (But make sure the battery voltage measurement circuit doesn’t waste too much current...)