Objects sink into water until the weight of water displaced is equal to the weight of the object. If the water weight that is displaced is less than the object’s total weight, the object sinks.
People are often confused how a chunk of steel, which sinks if thrown into water, can be formed into a ship that floats. The answer lies in the shape of the object. By forming a bowl shape from the steel, it causes more displacement of water as the air portion of the bowl also takes up space and displaces water. More water displaced equals more force acting against the object and results in heavy objects being able to float on water.
Another quality that affects an object’s ability to float is its density. Density is how heavy an object is compared to its volume. A piece of cork floats regardless of shape because it's less dense than water.
Lastly the water itself can impact the ability of objects to float. Seawater is slightly denser than water, so it can support slightly heavier objects. Also if the object is small enough (e.g. a small pin or insect) the surface tension of water may prevent it from sinking even if its density and shape would otherwise allow it.