We know that Hydrogen H has +1 charge and Oxygen O has -2 charge.
Since H2SO4 molecule is neutral so the charges will be balanced by Sulfur S
Now balancing the equation gives
2 x (+1) + S + 4 x (-2) = 0
Solving we get,
+2 + S - 8 = 0
S = +6
Thus, The oxidation number of S in H2SO4 is +6.