The substances that have high density than water sink in it and those having less density than water, floats on it. Ice has less density as compared to water, so it floats on water.
Why is the density of ice less than water?
Water has the molecular formula H2O, this means that one oxygen atom is bound with two hydrogen molecules to form one molecule of water. In water, there are many H2O molecules and there is a force of attraction among them which is called as hydrogen bonding.
When water is in the liquid state, these hydrogen bonds are not so strong and thus breaks and reforms continuously due to the continuous movement of water molecules.
When water starts freezing, the kinetic energy of water molecules decreases and they form the crystal lattice structure. In this crystal lattice structure, there exist many vacant spaces. This makes the density of ice lesser than that of water.