Turn off the power to the thermostat at your main electrical box.
Remove the cover of the old thermostat. Usually this will just pop off, but unscrew it if needed.
Remove the screws that hold the thermostat to the wall.
Label the wires with their letter designation (B, R, W and Y) so you know how to connect them to the new thermostat.
Disconnect the thermostat from the wires.
Unscrew and remove the base of the thermostat. Tape the wires to the wall so they don't slip inside it.
Place the base of the thermostat against the wall to see if the holes match up. If they don't, drill new holes and insert wall anchors.
Slide the wires through the base of the new thermostat and screw it to the wall.
Connect the wires to the proper screws on the new thermostat, following the diagram provided by the manufacturer.
Install the batteries (if the thermostat uses them) and attach it to the base.
Turn the power back on at the main electrical box and program the thermostat, following the manufacturer's instructions.