Your unknown compound contained 0.250 moles of oxygen.
Here's one way of solving this problem. You know that your compound contained 0.250 moles of carbon and 0.500 moles of hydrogen.
You can use the molar masses of carbon and hydrogen to determine how many grams of each of these two elements were in the sample.
Since the compound only contains carbon, hydrogen, and oxygen, the difference between its total mass and the added masses of carbon and hydrogen will be the mass of oxygen.
This is equivalent to having
SIDE NOTE I've assumed that your problem asks for the number of moles of oxygen present in the original sample. If this is not the case, leave a message in the comments section, I'll edit my answer accordingly.