Since you haven't supplied much detail, I'll have to use nonspecific examples based on typical installation methods.
Furnace and Condensing unit
If you have a setup where you have a furnace, and an outdoor condensing unit. The wiring will be similar to this (Note: This is a basic overview, not actual wiring).
R wire provides power to the thermostat.
G are energized depending on the state of the thermostat. For example. If the thermostat is set to the
COOL mode, and the temperature in the room is above the set point. The
G terminals of the thermostat will be energized. This tells the furnace to turn on the blower at high speed, and the condensing unit to turn on. Alternatively, if the thermostat is set to the
HEAT mode, and the temperature in the room is below the set point. The
W terminal will be energized, which tells the furnace to turn on.
If you have a heat pump, the wiring will be similar to this.
R wire again provides power to the thermostat. This type of setup uses either an
O/B terminals to change the state of the reversing valve in the heat pump. In this type of setup, the thermostat works similar to the example above, though it also has to manage an extra terminal.
Some thermostats offer both an
O and a
When the thermostat is in
COOL mode and calls for cool, the
O terminal will be energized. If you have a system where the reversing valve is normally in
HEAT mode, you'll use the
O terminal to move the reversing valve to
COOL mode. When the thermostat is in
HEAT mode and calls for heat, the
B terminal will be energized. If you have a system where the reversing valve is normally in
COOL mode, you'll use the
B terminal to move the reversing valve to
Some thermostats offer and
O/B terminal, and will have a jumper to select which function it provides.
In this case, you'll set the jumper based on the type of system you have. Then when the thermostat calls for heat or cool, the
O/B terminal will be energized appropriately.
For more information on the
C terminal, please see this answer.