Final answer:
A potassium atom loses one electron to form a potassium ion with a +1 charge, while a sulfur atom gains two electrons to form a sulfide ion with a -2 charge.
Step-by-step explanation:
Metals and nonmetals can react with each other to form ions through the transfer of electrons. When a potassium atom reacts, it loses one electron and forms a potassium ion with a +1 charge (K+). Potassium is an alkali metal and it typically loses one electron to achieve a noble gas electron configuration.
On the other hand, a sulfur atom typically gains two electrons to form a sulfide ion with a -2 charge (S2-). As a nonmetal, sulfur gains electrons to achieve an octet, resembling the electron configuration of a noble gas.