We somehow have got a mass of #2*g# nitrate ion, #NO_3^-#. We look at our Periodic Table, and we find that nitrogen #Z=7#, has 7 electrons, and oxygen, #Z=8#, has 8 electrons.
So per formula unit of #NO_3^-#, there are #7+3xx8+1=32*"electrons"#. Why did I add an extra electron.
Now we have a molar quantity of #(2*g)/(62.01*g*mol^-1)=3.23xx10^-2*mol#
And so there are #3.23xx10^-2*molxx6.022xx10^23*mol^-1xx32*"electrons"=?#
But hang on, #Z# specifies the number of protons in the nucleus. How can I use #Z# to define the number of electrons?