Traditional thermometers look like a glass tube, with a scale and a narrow tube in the middle which is filled with some kind of a liquid. In most cases the liquid is mercury, a metallic liquid. Some types of thermometers use alcohol as well. The reason for this is that mercury and alcohol expand when they are heated, and shrink when they are cold. The narrow tube in the middle is filled with mercury/alcohol and is completely closed, so when the liquid expands, it has nowhere to go, but up. The number scale on the side of the tube shows the current temperature. Digital thermometers work the same like, but the liquid is concealed.

how thermometers work