The formation of sodium chloride from its constituent's atoms is as follows:
Sodium (Z = 11) has the electronic configuration of 2, 8, 1. By losing one electron, it forms Na+ ion which attains the configuration of neon, i.e., 2, 8.
Chlorine (Z = 17) has the electronic configuration of 2, 8, 7. By gaining one electron, it forms a Cl- ion which attains the configuration of argon, i.e., 2, 8, 8.
Since, Na+ and Cl- ions carry opposite charges, a strong force of attraction binds the two ions together.
Thus, the compound NaCl is formed.
Explain by drawing a figure of the electronic configuration. Formation of sodium chloride: