At the cathode, positive ions gain electrons. Gaining electrons is called reduction, so the reactions at the cathode are reductions. At the anode, negative ions lose electrons. Losing electrons is called oxidation, so the reactions at the anode are oxidations.
The reaction at each electrode is written as a half equation that shows the electrons. At the cathode the electrons are on the left, because they are gained: 2H+ + 2e- → H2. At the anode the electrons are on the right, because they are lost: 2Cl- → Cl2 + 2e-.
Hydroxide ions give oxygen at the anode: 4OH- → O2 + 2H2O + 4e-. This can also be written 4OH- − 4e- → O2 + 2H2O. A half equation must balance for atoms and for charge, so check that the total charge is the same on both sides.