Electrolysis of water

Electrolysis of water is the decomposition of water into oxygen and hydrogen gas. This technique can be used to produce breathable oxygen or hydrogen gas as a fuel source, referred to as hydrogen fuel. However, that method is more expensive than the industrial way to produce hydrogen fuel from natural gas.
This is what is referred to as a non-spontaneous reaction which requires impetus.
At the cathode, reduction (in this case, the gain of electrons) occurs. At the anode, oxidation (in this case, the loss of electrons) occurs. Normally, the reaction is balanced with either an acid or a base as shown in the equations below.
That two reactions are half reactions. They are balanced with an acid. Commonly hydrochloric acid or sulfuric acid is used. However, the half reactions can also be balanced with a base, for example with sodium hydroxide.
Combining one pair of half reactions leads to an overall reaction, which is then the decomposition of water into oxygen and hydrogen.