D = M/V

M = Mass

V = Volume

Usually, the problems that ask for density will give you the values for both mass and volume. Sometimes it may not even give volume, in which case you'll have to use a specific formula for a specific 3D object to determine the volume, and THEN plug it into the density equation to solve for density.