Take two cubes, each 10 cm on a side, so each has a volume of 1,000 cm³. The aluminium cube has a mass of 2,700 g; the lead cube has a mass of 11,300 g. Dividing mass by volume gives 2.7 g/cm³ for aluminium and 11.3 g/cm³ for lead, so every cubic centimetre of lead carries about four times as much mass. That ratio is density, d=Vm, and rearranged it gives m=dV or V=dm when one of those is the unknown.
Density belongs to the material, not to the object. Cut the aluminium cube in half and each half has 500 cm³ and 1,350 g, still 2.7 g/cm³. Mass and volume shrink together, so their ratio stays put. That is why density can identify a substance: measure any piece, divide, and compare the result with a table.
Floating is a density contest. Water is 1.0 g/cm³. Ice (0.92), olive oil (0.92) and oak (about 0.75) float on it; iron (7.9) sinks. A steel ship floats because its hull encloses a huge volume of air, so the ship as a whole averages less than 1.0 g/cm³. Weight alone cannot predict this: a 500 kg log floats while a 5 g pebble sinks. Heavy is about total mass; dense is about mass in each cubic centimetre.
Think of it like this. Density is what one standard scoop of a material weighs. Take a 1 cm³ scoop out of anything and put it on a scale: water gives 1 g, iron about 8 g, cork about 0.2 g. The size of the object you scooped from does not change the scoop. For something hollow, like a ship, you have to average over the whole thing, air included.
Core idea. Density is mass divided by volume, a fixed value for each material at a given temperature, so it identifies substances and decides what floats: anything less dense than the liquid around it rises.