Thermostats can stop working for a variety of reasons.
Firstly, your thermostat could be outdated and in need of replacement. Check and see how old it is and see if you can’t replace it with a newer, more high-tech system.
Secondly, these systems rely on a steady flow of electricity, so you could be dealing with an electrical problem.
Thirdly, if there’s something wrong with the HVAC system, you’ll see problems reflected in your thermostat as well.