how does a boat float?
For example, consider an example made of aluminum. Aluminium has a density of about 2.7 grams per centimetre cubed - a lot more than water, at 1 gram per cc. if we squash that aluminum into a ball (or cube, or really any solid shape) it has that density and definitely won't float.
However, if we take our aluminum and shape a boat out of it, air now fills in the hollow. Air is so much lighter than water, and it floats quite easily. If we add up the mass of our air and our aluminum together, then figure out the density of the boat, it will be less than before (down to about half a gram per cc). Since this is less than the density of water, it floats.