The sodium metal loses the electron and forms a positively charged Na+ cation whereas chlorine nonmetal gains the electron and forms a negatively charged Cl– anion.
The Na+ and Cl– ions are linked together by the electrostatic force of attraction and during this force of attraction, a bond is formed which is called an ionic or electrovalent bond.