A water molecule is made from one oxygen atom and two hydrogen atoms, strongly joined to each other with covalent bonds. Water molecules are also attracted to each other by weaker chemical bonds (hydrogen bonds) between the positively-charged hydrogen atoms and the negatively-charged oxygen atoms of neighbouring water molecules. As water cools below 4°C, the hydrogen bonds adjust to hold the negatively charged oxygen atoms apart. This produces a crystal lattice, which is commonly known as 'ice'.
Ice floats because it is about 9% less dense than liquid water. In other words, ice takes up about 9% more space than water, so a litre of ice weighs less than a litre water. The heavier water displaces the lighter ice, so ice floats to the top. One consequence of this is that lakes and rivers freeze from top to bottom, allowing fish to survive even when the surface of a lake has frozen over. If ice sank, the water would be displaced to the top and exposed to the colder temperature, forcing rivers and lakes to fill with ice and freeze solid.