Whether an object floats or sinks depends on its density compared to the liquid it is placed in. If an object is less dense than the liquid, it floats. If it is denser, it sinks. Water pushes up on any object placed in it — this upward push is called buoyancy. When the buoyant force equals the weight of the object, it floats. Shape matters too: a solid ball of clay sinks, but the same clay shaped into a bowl can float because the bowl shape traps air and lowers the overall density.
Test a variety of objects in a tub of water (cork, coin, orange with peel, orange without peel, clay ball, clay boat). Predict first, then test. Shape clay into a ball (sinks) and then a boat (floats) to prove that shape changes how density works. Add salt to water and observe objects that sank in fresh water starting to float.
Drop a rock into a lake and it plunges straight to the bottom. Toss in a wooden stick and it bobs on the surface. Why does one sink and the other float? The answer comes down to density. If an object is denser than the water, gravity pulls it down harder than the water can push it up, and it sinks. If the object is less dense, the water pushes it up enough to keep it on the surface, and it floats.
The upward push that water gives to any object is called buoyancy (or the buoyant force). When you push a beach ball underwater, you can feel the water pushing it back up — that is buoyancy. The buoyant force exists because the water beneath an object pushes up harder than the water above it pushes down. If the buoyant force is equal to the object's weight, the object floats. If gravity is stronger, the object sinks.
Here is where things get interesting: shape can change whether something floats or sinks. A solid ball of clay sinks because clay is denser than water. But mold that same clay into a boat shape, and it floats. The clay did not get lighter — but the boat shape includes a lot of air inside. The overall density of the clay-plus-air combination is less than water. This is exactly how steel ships float. Steel is about eight times denser than water, but a ship's hull is hollow and full of air, making the average density of the entire ship less than water.
You can also change the liquid to affect floating and sinking. Salt water is denser than fresh water because dissolved salt adds mass without adding much volume. In the Dead Sea, the water is so salty and dense that people float effortlessly on the surface. An egg sinks in fresh water but floats in very salty water — same egg, different liquid density. Understanding floating and sinking connects density, gravity, and buoyancy into one beautiful explanation for why some things stay on top and others go to the bottom.