How can I write the formula for sodium sulfide?
The formula for sodium sulfide is
Since this is an ionic compound, you must balance the charges so that overall charge of the compound is neutral.
Sodium, an alkali metal, has a tendency to lose one electron.
As a result sodium normally carries a positive one charge.
Sulfur, a nonmetal, has a tendency to gain 2 electrons.
This results in an ion with a negative 2 charge. Nonmetal ions end in "ide".
To obtain a neutral charge, you need two sodium ions, which provides you with a plus 2 charge balance the negative 2 charge of sulfur.