The answer to 'how to fix thermostat' is to first check the batteries and replace them if needed. Next, inspect the thermostat for any loose wiring connections and tighten them. You can also try resetting the thermostat by turning the power off at the circuit breaker, waiting a few minutes, then turning the power back on.
If the thermostat still isn't working properly, you may need to replace the entire unit. This is a relatively simple DIY project, but if you're not comfortable working with electrical components, it's best to call an HVAC technician to handle the replacement.