Oxidation is the loss of electrons or an increase in oxidation state by a molecule, atom, or ion. Reduction is the gain of electrons or a decrease in oxidation state by a molecule, atom, or ion.
Here,
O+2e−→O2− in this reaction, oxygen atom is getting two electron and form an anion so its a reduction process.