* Magnesium (Mg) is in Group 2 of the periodic table, meaning it has a +2 charge as a cation (Mg²⁺).
* Sulfur (S) is in Group 16 of the periodic table, meaning it has a -2 charge as an anion (S²⁻).
To form a neutral compound, the charges must balance. Since the charges are equal and opposite, one magnesium ion (Mg²⁺) combines with one sulfide ion (S²⁻) to form MgS (Magnesium sulfide).