It was known for a long time that the volume of a fixed amount of gas increased with increasing temperature before Galileo found a practical use for this phenomenon to measure temperature changes. His air thermometer consisted of a glass bulb connected to a long thin tube dipped into water as shown below.
The bulb is first warmed then the bottom thin end is put into water. The bulb then cools and water is drawn into the tube. The length of the water column can be used to indicate temperature. When the temperature decreases, the volume of air decreases and more water is drawn into the tube so the water level rises. When the temperature increases, the volume of air increases and water is expelled from the tube so the water level falls. The tube can be calibrated as with a thermometer to record the temperature.
The instrument does have one drawback - readings are affected by the atmospheric pressure as well as temperature. This makes the readings it gives very inaccurate. Since cold temperatures are often accompanied by a fall in pressure the thermometer will often overestimate the temperature and since warm temperatures are often accompanied by an increase in pressure the thermometer will often underestimate the temperature.