Ions are formed when atoms of element gain or loose electrons.
<em><u>When an atom looses electrons it forms a positively charged ion and when an atom gains electrons it forms a negatively charged ion.</u></em>
Metal atoms such as potassium, magnesium and aluminium looses outer most electrons to positively charged ions.
<u>Potassium atom has 19 electrons, 19 protons, with an electronic configuration of 2 : 8 : 8 : 1.</u> <u><em>To form an ion, K looses an electron to form a positively charged potassium ion (K+) with 18 electrons and 19 protons and an electronic configuration of 2:8:8.</em></u>