Read a chemical name like a postal address, where each part narrows things down. In iron(III) chloride, "iron" is the cation, "(III)" says its charge is +3, and "chloride" is the anion Cl−, the element's name with its ending changed to -ide. Put together, the formula must be FeCl3. The Roman numeral is needed because iron also forms Fe2+, and iron(II) chloride, FeCl2, is a different compound. Sodium never needs one, since it only forms Na+.
Compounds of two nonmetals have no ion charges to fix the ratio, so the name counts the atoms with Greek prefixes: mono-, di-, tri-, tetra-, penta-. CO is carbon monoxide, CO2 is carbon dioxide and P2O5 is diphosphorus pentoxide; the first element drops mono-. Polyatomic ions keep their own names: NaNO3 is sodium nitrate and NaNO2 is sodium nitrite, the -ate ion having one more oxygen. Their acids follow the pattern -ate to -ic and -ite to -ous: HNO3 is nitric acid, HNO2 is nitrous acid.
The prefixes belong to molecular compounds only. CaCl2 is calcium chloride, not calcium dichloride, because calcium's +2 charge already forces two chlorides, so di- would tell the reader nothing. That makes the first decision in naming the compound type: a metal or ammonium with nonmetals means ionic naming, and two nonmetals means prefixes.
Think of it like this. A chemical name works like a full postal address: every part together points to exactly one house, and dropping the house number can send the letter to the wrong door. For iron compounds the Roman numeral is that house number. Unlike an address, a chemical name also lets you rebuild the formula itself.
Core idea. Sort the compound by type first. Ionic names give the cation, with its charge as a Roman numeral when it can vary, then the anion; molecular names count atoms with Greek prefixes; acid names follow -ic and -ous.