Mass of a block is 3.9 kg and volume is 0.0005 m. Find density in g/cm

You have the units. g/cm^3 means you divide mass by volume

3.9kg/.0005m^3 * 1000g/kg * (m/100cm)^3 = 7.8 g/cm^3

Remember that nothing changes when you multiply by one. The way to convert units is to write "1" in a way that cancels the units you don't want. This was one of the handiest things I learned in physics. KEEP THE UNITS AROUND! They will show you what manipulations you need to do.