in the electronic configuration say for example oxygen has 6 electrons in its valence shell while there are 2 electrons in its inner shell. if you add the 6 electrons + 2 electrons you get 8 which is the atomic number of oxygen
hope I helped u..
plz mark as the best
if u have any confusion feel free to message me.:D