How do you find the number of valence electrons in an atom?
Group number or using proton number.
Most of the time you can determine the number of valence electrons by the number of the group it is in. For example,
However it is not always conventional as transition metals does not technically have a group number. Thus we use its proton number. Since atoms are nuetrally charged, proton number = electrons in any atom. Thus, we can determine its electron number and write our its configuration.