The shape of the water molecule is the reason why water expands when it freezes. Water expanding instead of shrinking when freezing is weird for a substance because usually when something is cooled, the speed of the molecules slows down. They vibrate less and therefore take up less space.
The water molecule kind of looks like a Mickey Mouse head though, with the hydrogen atoms being the ears and the oxygen atom being the face. Because the oxygen has a slightly negative charge and the hydrogen atoms have a slightly positive charge, water molecules tend to stick together and form bonds. The weird shape of these molecules causes them to create a very open structure though when they link together. It forms a lot of holes and gaps, meaning there’s a bunch of extra space taken up. When water undergoes the freezing process, it creates a lot of these bonds. So all these extra bonds take up extra space and cause water to expand when it freezes instead of shrinking.