Na (atomic no. 11) reacts with cl (atomic no. 17) to become stable. In the reaction, Na will give up one electron, while cl will accept on electron.
NaCl is formed by Na⁺ cation and Cl⁻ anion as follow,
Oxidation of Na;
Na → Na⁺ + 1 e⁻
In this step sodium looses one electron due to less ionization energy as the resulting Na⁺ ion has attained a stable noble gas configuration of Neon (i.e. 1s², 2s², 2p⁶).
Reduction of Cl₂;
Cl₂ + 2 e⁻ → 2 Cl⁻
In this step each Chlorine atom accepts one electron and forms Chloride ion (Cl⁻). Again the driving force for this step is attaining the noble gas configuration of Argon (i.e. 1s², 2s², 2p⁶, 3s², 3p⁶).
Crystal Lattice formation is as follow,
Na⁺ + Cl⁻ → NaCl