If the object has a regular shape, like a cube or sphere, its volume can be calculated readily from solid geometry. Weight divided by volume gives density.
For an irregular shape, one trick for finding volume is to submerge it in a calibrated container of water. The amount of increase in the volume of the water is the volume of the object.