The oxidation number for element S in Na2SO4
You're dealing with sodium sulfate, an ionic compound composed of sodium cations, Na+, and sulfate anions, SO2−4, in 2:1 ratio.
Start with what you know. Sodium has an oxidation state that matches its overall ionic charge, so right from the start you know that sodium will have an oxidation state of +1.
Now focus on the sulfate anion.
In most compoiunds, oxygen has an oxidation state of −2.
When dealing with ions, the oxidation states of all the atoms that make up the ion must add up to give the overall charge of said ion.
In this case, the overall charge of the sulfate anion is (2−). As you know, oxidation state are assigned per atom, so you can say that
1×ONsulfur+(4×ONoxygen)=−2
This means that the oxidation state of sulfur is
ONsulfur+4⋅(−2)=−2
ONsulfur=−2+8=+6