when 18.66 g of magnesium react with 22.28g of oxygen, 30.94g of megnesium oxdie forms. If all the magnesium reacts, how many grams of oxygen remain un-reacted?

2Mg + O2 ==> 2MgO

Convert 18.66 g Mg to mols.
Convert mols Mg to mols oxygen (which is mols oxygen USED).
Convert mols oxygen to grams and subtract initial mols - mols used = mols remaining.
Post your work if you need more help.