Explanation:
The chemical formula magnesium sulfide written as MgS and NOT because charge on magnesium ion is +2 and charge on sulfide ion is -2.
Therefore, these charges will cancel out each other as we write the formula in simplest crisscross method.
Also, the numbers in a chemical formula display the total number of atoms attached with each other or central atom.
For example, in there are two chlorine atoms attached to one calcium atom.
Therefore, denotes one sulfur atom is attached to magnesium atom. Hence, we do not write the formula of magnesium sulfide as because this shows two magnesium atoms are attached to two sulfur atoms which is not true.