Both the sodium and the chlorine atoms need to obtain a stable electron configuration, thus, a complete outer shell of eight electrons.
Sodiums electron design is 2,8,1 and chlorines electron setup is 2,8,7. So all together for the two molecules of the two components to get a total external shell of eight electrons, sodium will give one electron to chlorine, and the chlorine particle will acknowledge the gave electron when responded with each other.
This outcomes in the sodium particle having an electron arrangement of 2,8 so is currently total. The chloride particle currently has an electron configuration of 2,8,8.
Since the molecules have moved toward becoming particles to end up stable, the Na+ and the Cl-particles draw in one another because of their contrary charges, which results in an ionic bond.
This is the reason sodium and chlorine cling to each other when responded.