The keys here are the Roman numerals used to name the two compounds.
As you know, transition metals can have multiple oxidation states. In order to distinguish between these possible oxidation states, we use Roman numerals.
The Roman numerals are meant to describe the oxidation state of the transition metal in a given compound.
In this case, you have
The (II) Roman numeral tells you that iron has a
Now, both of these ionic compounds have oxide,
This implies that the overall positive charge coming from the cations must be balanced by the overall negative charge coming from the anions.
For iron(II) oxide, you have
#["Fe"^(2+)] + ["O"^(2-)] -> "FeO" ->#iron(II) oxide
For iron(III) oxide, you have
The chemical formula will thus be
#color(blue)(2) xx ["Fe"^color(red)(3+)] + color(red)(3) xx ["O"^color(blue)(2-)] -> "Fe"_2"O"_3 ->#iron(III) oxide