Explain redox reaction on the basis of electron transfer. Given suitable examples.

As we know that, the reactions
are redox reactions because in each of these reactions sodium is oxidised due to the addition of either oxygen or more electronegative element to sodium.
From our knowledge of chemical bonding we also know that, sodium chloride and sodium oxide are ionic compounds and perhaps better written as Na+Cl-(s) and (Na+)2O2-(s).
Develpment of charges on the species produced suggests us to rewrite the above reaction in the following manner
For convenience, each of the above processes can be considered as two separate steps, one involving the loss of electrons and other the gain of electrons. As an illustration, we may further elaborate one of these, say, the formation of sodium chloride.
Each of the above steps is called a half reaction, which explicitly shows involvement of electrons. Sum of the half reactions gives the overall reaction:
2Na(s)+Cl2(g)2Na+Cl-(s) or 2 NaCl(s)
The given reactions suggest that half reactions that involved loss of electrons are oxidation reactions. Similarly, the half reactions that involve gain of electrons are called reduction reactions.
It may be out of context to mention here that the new way of defining oxidation and reduction has been achieved only by establishing a correlation between the behaviour of species as per the classical idea and their interplay in electron-transfer change.
In the given reaction, sodium, which is oxidised, acts a reducing agent because it donates electron to each of the elements interacting with it and thus helps in reducing them. Chlorine and oxygen are reduced and act as oxidising agents because these accept electrons from sodium.
To summarise, we may mention that
Oxidation Loss of electron(s) by any species.
Reduction Gain of electron(s) by any species.
Oxidising agent Acceptor of electron(s).
Reducing agent Donor of electron(s).