Explanation:
that's why it is so important to always write also the units a number represent.
and for a fully nice scientific notation you write also at least 1 digit after the decimal point.
(a) 6.0 × 10²⁴ kg
(b) 4.0 × 10² g
now,
1 kg = 1000 g ("kilo" means 1000)
so, in order to be able to compare the 2 numbers, you have to bring both numbers to the same unit. either both to kg or both to g.
6.0 × 10²⁴ kg = 6.0 × 10²⁴ × 1000 g = 6.0 × 10²⁷ g
or
4.0 × 10² g = 4.0 × 10² / 1000 kg = 4.0 × 10^-1 kg
once you have both showing the same unit, you can truly compare them.