Sodium is a highly reactive metal that readily loses its valence electron to form a positively charged ion (Na+). Sulfur, on the other hand, is a non-metal that tends to gain electrons to complete its outer shell. When these two elements come together, sodium's tendency to lose electrons matches well with sulfur's tendency to gain electrons. This results in the formation of an ionic compound, sodium sulfide (Na2S), where sodium atoms transfer their electrons to sulfur atoms, creating positively charged sodium ions (Na+) and negatively charged sulfide ions (S2-). The electrostatic attraction between these oppositely charged ions holds the compound together in an ionic lattice.