The first step here is to determine the mass of C in CO2 and the mass of H in H2O. This is done by dividing the relative atomic mass, Mr, by the relative molecular mass of the compound, MCO2 or MH2O, and then multiplying by the mass of compound produced.
For C:
(12.011 g / 44.009 g) x 0.3664 g = 0.1000 g
For H:
(1.0079 x 2 / 18.0148) x 0.1500 g = 0.0168 g
From here we can determine the mass of oxygen in the hydrocarbon by subtraction of the two above masses:
O: 0.2500 g - 0.1000 g - 0.0168 g = 0.1332 g
From here we determine the number of moles of each element, this is done by dividing by the mass of each element by its atomic mass:
C: 0.1000 g / 12.011 g mol-1 = 0.0083 mol
H: 0.01678 g / 1.0079 g mol-1 = 0.0166 mol
O: 0.1332 g / 15.999 g mol-1 = 0.0083 mol
The final step is to divide by the smallest number that obtained, in this case that is the number of moles of C and O:
C: 0.0083 mol / 0.0083 mol = 1
H: 0.0166 mol /0.0083 mol = 2
O: 0.0083 mol / 0.0083 mol = 1
We have now arrived at a ratio of 1:2:1 for C:H:O, thus we have an empirical formula of CH2O.