Hot particles need more room
When matter is heated, its particles move faster. Fast particles bump each other harder and push each other a little farther apart. So the whole object takes up a little more space. We say it expands.
When matter cools, its particles slow down and stay closer together. The object takes up a little less space. We say it contracts.
The particles themselves do not get bigger or smaller. Only the spaces between them change.
(Remember water's surprise from the freezing lesson: liquid water expands when it freezes into ice. Most other matter does not do that.)
How a thermometer works
Many thermometers have a thin glass tube with a coloured liquid inside, often a kind of alcohol. When the thermometer warms, the liquid expands and has nowhere to go but up the tube. When it cools, the liquid contracts and moves down. The numbers beside the tube tell us the temperature.