Reaction of of water and magnesium initially forms a thin layer of Mg(OH)2which prevents further reaction of Magnesium hence in cold water Mg and water do not react.
When Mg is exposed to air,it forms an oxide layer, this oxide layer prevents it from reacting and thus does not give desired results. Hence the oxide layer has to be removed.