When a solid is placed in a liquid , the liquid excerts a force on solid. This force is called buoyant force.
This buoyant force is proportional to the volume of body sunk, which is equal to volume of liquid displaced.
When, the buoyant force from liquid is more than mass of body, then the body will float.
When buoyant force ia less than the weight of body, body sinks.
Consider a piece of wood. Wood has less mass, that means less weight. But wood has large volume, size. So, wood has less density, density=mass/volume.
So, when wood is put in water, it will diaplace large amount of liquid, so buoyant force is large. So, wood floats.
But steel on other hand has high density, so it has large mass. So, steel sinks in water.
So, Generally, if solid has lesser density than liquid, solid will float. When solid density is more than that of liquid, it will sink.