The thing to remember when looking to determine the density of a given substance is that your ultimate goal is to find the mass of exactly
That is, in essence, what density means--the mass of
In your case, the volume of the sample is given to you in milliliters,
Now, you know that
#1 color(red)(cancel(color(black)("mL"))) * "6 g"/(24.0 color(red)(cancel(color(black)("mL")))) = "0.3 g"#
Since this represents the mass of exactly
#color(darkgreen)(ul(color(black)("density = 0.3 g mL"^(-1)))) ->#every #"1 mL"#of this substance has a mass of #"0.3 g"#
The answer must be rounded to one significant figure, the number of sig figs you have for the mass of the sample.