The molecular formula gives us the total number of atoms of the compound. To do this we are going to count each of the atoms.
We have:
C = 4
H = 8
O = 2
So, the molecular formula will be C4H8O2
The empirical formula is the simplest way to represent a molecule, we simplify taking the denominators of the molecule to its simplest form, as they are all multiplies of two we can divide everything by this number and thus we obtain the empirical formula.
So, the empirical formula will be C2H4O