The most common type of thermometer uses a liquid, such as mercury or alcohol, that expands as it gets warmer. The liquid is held in a glass tube with a narrow bore, and the expansion of the liquid causes a level of the liquid in the tube to rise or fall. The height of the liquid column is calibrated to indicate the temperature.
Other types of thermometers use different physical properties to measure temperature. For example, a thermocouple uses the Seebeck effect, which is the generation of a voltage when two different metals are joined and heated. The voltage is proportional to the temperature difference between the two metals.
Resistance thermometers use the fact that the electrical resistance of a material changes with temperature. The resistance of a semiconductor, for example, increases with temperature. A resistance thermometer uses a semiconductor to sense the temperature, and the change in resistance is converted to a voltage.
Digital thermometers use a sensor to convert temperature directly into an electrical signal. The signal is then processed by a microcontroller to display the temperature on a digital display.
Regardless of the type of thermometer, the basic principle is the same: measure a physical property that changes with temperature, and calibrate the measurement to indicate the temperature.