It's important to be familiar with the basics of thermostat wiring if you plan on installing or replacing your current thermostat. Thermostat wiring can be confusing and wires should be labeled with masking tape if you're going to replace your thermostat. Always make sure you shut off power to the area you'll be working to avoid getting an electrical shock when doing work on your thermostat.
Thermostats are hooked up to heating and cooling systems via a circuit board. Thermostat wiring connects to the screws on the circuit board and then to either the heater or the air conditioner. Thermostats may have either one transformer (R) or two transformers; one for the heating system and the other for the air conditioner. These may be labeled RH (for heat) and RC (for cool). Transformer wires are usually red, but this may not be the case, so check it out before getting too involved in your project. The transformers connect to two relay wires: W and Y. The W wire (which is white) connects to the heating system while the wire labeled Y (and is yellow) is connected to the air conditioner. Some thermostats come with two additional wires labeled W2 and Y2 which are used for heating and cooling second stage. These wires would be brown and light blue, respectively. Another wire, G (which is green), simply turns on the fan.
The wiring for a digital thermometer is a bit different because the digital thermometer operates using a resistor. A digital thermometer will usually have the C wire, which is the thermostat terminal.