Ions are charged particles - they can be single atoms or groups of atoms
When atoms lose or gain electrons to form ions, all they're trying to do is get a full outer shell like a noble gas (also called a 'stable electronic structure')
Atoms with full outer shells are very stable
When metals form ions, they lose electrons from their outer shell to form positive ions
When non-metals form ions, they gain electrons into their outer shell to form negative ions
The number of electrons lost or gained is the same as the charge on the ion. E.g. if 2 electrons are lost the charge is 2+
Groups 1&2 and 6&7 are most likely to form ions
The elements that mostly readily form ions are those in groups 1,2,6 and 7
Group 1 and 2 elements are metals and they lose electrons to form positive ions (cations)
Group 6 and 7 elements are non-metals. They gain electrons to form negative ions (anions)
Elements in the smae group all have the same number of outer electrons. So they have to lose or gain the same number to get a full outer shell. This means they form ions with the same charges
A sodium atom (Na) is in group 1 so it loses 1 electron to form a sodium ion (Na+) with the same electronic structure as neon:
Na -> Na+ + e-
A magnesium atom (Mg) is in group 2 so it loses 2 electrons to form a magnesium ion (Mg2+) with the same electronic structure as neon: Mg -> Mg2+ + 2e-
A chloride atom (Cl) is in group 7 so it gains 1 electron to form a chloride ion (Cl-) with the same electronic structure as argon: Cl + e- -> Cl-
An oxygen atom (O) is in group 6 so it gains 2 electrons so it gains 2 electrons to form an oxide ion (O2-) with the same electronic structure as neon: O -> 2e- -> O2-