An oxidising agent is the one which oxidises other substances (by removal of hydrogen or addition of oxygen) and itself gets reduced (addition of hydrogen or removal of oxygen).
2Mg+O2→2MgO
In the above reaction, oxygen acts as an oxidising agent as it oxidises magnesium (Mg) to form magnesium oxide (MgO).