Buoyancy is an upward force exerted by a fluid that counters the weight of the object. It increases with depth, that's why if you ever submerge something less dense than water- like a kickboard, as you push it further and further in water, the force exerted back gets increasingly harder.
The force is equivalent to the mass of the liquid that would take up that area, so if the object is denser than the liquid, it would sink.
That's why Diet Coke floats and Coke sinks, the artificial sweetener in Diet Coke, aspartame, weighs significantly less than the sugars in Coke, thus having a lower density, making it float on water.