Voltage comparator - how to get a stable voltage reference from a battery
Here's a circuit I did for a similar question you raised yesterday. It uses a very low-power voltage reference such as the MAX6006 (it consumes less than 1 μA) or the LT1389 which is also sub μA consumption. Because they are shunt references they will work down to quite low battery voltages.
For instance, with 0.5 μA flowing to feed the reference, R3 drops 1.025 volts hence the battery voltage can fall to 2.275 volts before the reference voltage starts to fail in stability and accuracy.
The op-amp is also very low power (less than 0.5 μA current consumption for the LPV521) and therefore is good for monitoring a battery especially as the input bias currents are around 40 fA typically (that's not a lot).: -

If the battery voltage is ramped from 1 volt to 4 volts, you can see the points where the comparator switches: -

As the battery voltage rises, the output triggers on at 3.79 volts and, as the battery voltage falls, the output switches to 0 volts at 3.64 volts. The points are not the same due to a small amount of hysteresis in the circuit caused by R5 and R4.
Link to a similar answer