It is given that the mass ration of sulphur and oxygen in SO3 is 2:3. That is 2g sulphur will react with 3g of oxygen. So the mass of sulphur for 24g of oxygen can be found from law of definite proportion which say that the mass of elements in a pure compound is always fixed.
Sulphur. Oxygen
2 3
? 24g
So ?= 24x2/3 = 16g
So the masss of sulphur is 16g