At 4 °C (39.2 degrees fahrenheit), the clusters start forming. The molecules are still slowing down and coming closer together, but the formation of clusters makes the molecules be further apart. Cluster formation is the bigger effect, so the density starts to decrease. Thus, the density of water is a maximum at 4 °C.

The water molecules in ice are present in a crystal lattice that has lot of empty space. When ice melts to liquid water density of the liquid increases as the structure collapses. At temperatures well above freezing, the molecules move faster and get further apart. The density decreases as temperature increases.

More Info: www.vedantu.com