In terms of electrons, oxidation is the loss of electrons and reduction is the gain of electrons. A handy way to remember it is OIL RIG: Oxidation Is Loss, Reduction Is Gain.
A magnesium atom becomes a magnesium ion by losing two electrons: Mg → Mg2+ + 2e-. The magnesium has been oxidised because it lost electrons.
A copper ion becomes a copper atom by gaining two electrons: Cu2+ + 2e- → Cu. The copper ion has been reduced because it gained electrons. In the half equation 2Cl- → Cl2 + 2e-, chloride ions lose electrons, so chloride is oxidised.