a certain hydrocarbon has the analysis C=85.84% and H=14.16%. the density of its vapour is 2.50g/L at STP. find the empirical and molecular formula.

Take 100 g sample.

That gives you 85.84% C and 14.16 g H.
Convert to mols.
85.84/12 = mols C = ?
14.16/1 = mols H = ?

Now find the ratio of these to each other. The easy way to do that is to divide the smaller number by itself and divide the other number by the same small number. I believe this will be CH2 for the empirical formula and the mass will be 14.
Then (empirical mass)*whole number = 2.5 g/L x 22.4. Find the whole number and that becomes the multiplier for the formula of (CH2)n.
By the way, the 2.5 g/L x 22.4 convert grams/1 L to grams/22.4 L and that is a mols of gas.