To do any conversion, find the relationship between the two units. In this case,
1 cm = 10 mm
This gives you two conversion factors:
1 cm/10 mm and 10 mm/1 cm
and if look at the equation, you'll see that
1 cm/10 mm = 10 mm/1 cm = 1
To convert 3 cm into mm, multiply by a conversion factor:
3 cm × (10 mm/ 1cm) = 30 mm
note that the "cm" cancels out, leaving you with the answer in mm.
To convert 30 mm into cm, multiply by the other conversion factor:
30 mm × (1 cm/10 mm) = 3 cm
Again, some of the units cancel out, leaving you with the units you want.