Write the symbols for the cation and the anion: Mg and Cl.
Determine the charge on the cation and anion. If the cation has a Roman numeral after it, that is the charge on that cation. ...
Determine formula.