The example used:

Calculate the percent Na, S and O in the compound Na2SO4.

To start the calculation, assume 1 mole of Na2SO4.  Set up a table and make the calculations as follows:

element
moles
molar mass
/g mol-1
mass*
/g
percent**

Na 2
23.0
46.0
32.4 %
S
1
32.0
32.0
22.5 %
O
4
16.0
64.0
45.1 %
total


142.0


*From the definition of molar mass:
m = nM

** percent definition: