This is because the molecules in a liquid have more energy than those in a solid. As you cool a liquid, the molecules lose energy and slow down. This allows the attractive forces between the molecules to pull them closer together, creating a more organized structure - a solid.
Here are some common examples:
* Water becomes ice
* Molten metal becomes a solid metal
* Liquid mercury becomes solid mercury