* Sodium (Na) is a metal and has a tendency to lose one electron to achieve a stable electron configuration. This forms a positively charged ion (Na+).
* Sulfur (S) is a nonmetal and has a tendency to gain two electrons to achieve a stable electron configuration. This forms a negatively charged ion (S2-).
The oppositely charged ions (Na+ and S2-) are then attracted to each other through electrostatic forces, forming an ionic bond. This results in the formation of the compound sodium sulfide (Na2S).