Almost everything gets denser as it cools and solidifies, so its solid form sinks in its own liquid. Water is a famous exception: as it cools toward freezing, its molecules lock into a hexagonal crystal held apart by hydrogen bonds, and that open structure makes solid ice about 9% less dense than liquid water. So ice floats.
This quirk has enormous consequences. When a lake freezes, ice forms on top and insulates the water below, so fish and other life survive the winter in liquid water beneath. If ice sank, lakes and even oceans would freeze solid from the bottom up, and aquatic ecosystems as we know them couldn't exist. A property that seems like trivia is actually a precondition for life in cold climates.