If you are given 46 grams of magnesium how many grams of hyfrogen will be produced?

You did not say what the Mg was reacting with. I will assume water

atomic mass H = 1 so H2 is 2
atomic mass Mg = 24
Mg (s) + 2H2O(g) -> Mg(OH)2(aq) + H2(g)
for every 2 grams of H2 you need 24 grams of Mg

Mass H2/Mass Mg = 2/24 = 1/12
so
46 * 1/12 = 3.8