The ship do not sink in water due to Archimedes principle.
Archimedes’ Principle: a body totally or partially immersed in a fluid experiences an upthrust equal to the weight of fluid displaced.
A ship which has a large weight displace a large volume (thus large weight) of water. Hence the buoyancy force acting on the ship is much greater than the weight of the ship itself, making it to float on water.Thus ship do not sink in water.