Atoms achieve noble gas notation by gaining or losing electrons in order to satisfy the rule of octet. (duet for hydrogen and helium)
Each atom seeks the stability of eight electrons in the s and p orbital of the valence shell to become stable like the noble gases.
Sodium has eleven total electrons arranged in an electron configuration of
the noble base notation would be
If sodium were to release the electron from the 3s orbital it would have the same notation as Neon
On the other hand,
Oxygen has eight total electrons arranged in an electron configuration of
If oxygen were to gain two electron for the 2p orbital it would have the same notation as Neon
By gaining and losing electrons the atoms become like the noble gases and become stable following the rule of octet.
I hope this was helpful.