How do you work out the molecular formula?
Generally you convert grams to mols, then find the ratio of the atoms to reach other. But this is all generality. Why don't you post the entire problem, tell us what you know how to do and what you don't understand about it and let us provide some hints to work the problem.