If the density of the material of the body is less than that of density of water, it floats and in case if the density of the material of the body is more than that of density of water, it sinks.
The cork floats while the nail sinks. This is because of the difference in their densities. The density of cork is lesser than the density of water. This means that the upthrust of water on the cork is greater than the weight of the cork. So it floats.
The density of the iron nail is more than the density of the water. This means that the upthrust of water on the iron is lesser than the weight of the nail. So it sinks.
Therefore objects of density less than that of a liquid float on the liquid. The objects of density greater than that of a liquid sink in the liquid.