
Theory

The electrons removal or addition, needed for the chemical reaction ( Interchange of atoms ) is done by a voltage applied by an external circuit.
The equation is given below.
2NaCl + 2 H2O → 2 NaOH + H2 + Cl2
Electrolyzing an NaCl solution at home

At home, you can easily use the method of electrolysis to make NaOH.
For electrodes pencils are used. And the container is separated into two chambers using a paper layer, in order to prevent the reaction between Chlorine and Hydrogen, which were by products of the reaction.
The following video shows how it's done.