Convert grams of CO2 to moles of CO2 and then use the mole ratio of 1 mol C / 1 mol CO2 (since every mole of CO2 has 1 mol of carbon in it) to find moles of carbon.
Do the same for H2O except the mole ratio is 2 mol H / 1 mol H2O, since every mole of H2O has two moles of hydrogen in it.
0.40 g CO2 • 1 mol CO2/44.01 g CO2 • 1 mol C / 1 mol CO2 = 0.0091 mol C
0.205 g H2O • 1 mol H2O/18.02 g H2O • 2 mol H / 1 mol H2O = 0.0228 mol H
Now divide by the smallest number of moles (0.0091 moles of C) to get whole number values for both C and H rather than decimals.
0.0091/0.0091 = 1 mol C
0.0228/0.0091 = 2.5 mol H
You need whole numbers for both C and H, which you can get by just multiplying both by 2 (since 2.5 • 2 is 5).
So, your empirical formula ends up being C2H5.