Evaporation: When a liquid evaporates, its molecules escape from the surface and enter the gas phase. As the molecules leave the liquid, they take energy away with them, causing the liquid to cool down. If the liquid is cooled enough, it will eventually freeze and become a solid.
Pressure: When a liquid is subjected to high pressure, its molecules are forced closer together. This can cause the molecules to form stronger bonds with each other and eventually become a solid.
Chemical reaction: Some liquids can become solids when they undergo a chemical reaction. For example, when water reacts with sodium hydroxide, it forms sodium hydroxide hydrate, which is a solid.