I recently performed an experiment in which magnesium oxide formed.

I have to find out the simplest whole number ratio of Mg atoms to O atoms.
How do I go about doing this?

Mass MgO - mass Mg initially = mass oxygen added.

%Mg = [mass Mg/mass MgO]*100 = ??
%O = [mass O/mass MgO]*100 = xx

Now ??/atomic mass Mg =
and xx/atomic mass O =
and go from there.