Final answer:
Atoms gain, lose, or share electrons in chemical changes to achieve a stable octet. Sulfur forms S2- by gaining two electrons, magnesium forms Mg2+ by losing two electrons, and chlorine forms Cl- by gaining one electron.
Step-by-step explanation:
In chemical changes, atoms gain, lose, or share electrons in order to achieve a stable octet, which refers to having eight electrons in their outermost energy level.
In the case of sulfur forming S2-, it gains two electrons to achieve a stable octet. Similarly, magnesium forms Mg2+ by losing two electrons to achieve a stable octet. Chlorine forms Cl- by gaining one electron to achieve a stable octet.
These changes occur through the process of bonding, where atoms combine to form compounds and achieve a stable electronic configuration.