In general, here's a way to keep it straight.
(12 KM/1) * (1000 m/KM) * (100 cm/m) * (1 inch / 2.54 cm) * (1 ft / 12 inches)
Notice how each one of the units cancels out with each subsequent factor. In the end, all you have are feet. If you know the conversion factors and write out each step of conversion, you can make sure your final units are correct, and that's the only tricky part. At least I hope that's the question you were really asking.
Alternatively, (12 Km/1) * (1 mile / 1.609344 km) * (5280 feet / mile)
works too.