Sodium Sulfate or Sodium Carbonate for electrolysis in water
If you electrolyze a solution of sodium carbonate, it will be fine at the beginning. Later on, some problem may happen around the anode where $\ce{O2}$ is released. Indeed some acid ($\ce{H+}$) is produced in solution according to the half-equation : $$\ce{2H2O -&gt; 4 H+ + O2 + 4 e-}$$ and these acidic ions $\ce{H+}$  react with the carbonate ions $\ce{CO3^{2-}}$according to $$\ce{CO3^{2-} + H+ -&gt; HCO3^- + H2O}$$ In presence of the ion sodium $\ce{Na+}$, the ion hydrogenocarbonate $\ce{HCO3^-}$ reacts to produce sodium hydrogenocarbonate $\ce{NaHCO3}$ which is not very soluble in water, and may make a white deposit around the anode $$\ce{Na+ + HCO3^- -&gt; NaHCO3(s)}$$ Furthermore if the electrolysis is continued a long time, a supplement of acid ions will react with these $\ce{HCO3^-}$ ions producing some $\ce{CO2}$ by the reaction  $$\ce{H+ + HCO3- -&gt; CO2 + H2O}$$
$\ce{CO2}$ is a gas, and it is relatively soluble in water. In the beginning the $\ce{CO2}$ produced will stay dissolved in the liquid. But on the long run, $\ce{CO2}$ will get out of the solution and get mixed with the oxygen produced at this electrode. So instead of getting pure $\ce{O2}$ at the anode, you will obtain a mixture $\ce{O2 + CO2}$.
So you better use a solution of sodium sulfate $\ce{Na2SO4}$ instead of sodium carbonate. The above mentioned drawbacks do not occur with sodium sulfate.
In a $\ce{Na2SO4}$ solution, the ions $\ce{Na+}$ are moving towards the negative electrode (cathode), and the ions $\ce{SO4^{2-}}$ are moving toward the positive electrode (anode). They move but they don't touch their electrodes and they are not discharged. Instead that is water that either give or absorb electrons.
At the negative electrode (cathode) where $\ce{Na+}$ ions are approaching, the following reaction occurs :  $$\ce{2 H2O + 2 e- -&gt; H2 + 2 OH-}$$ and the $\ce{OH-}$ ions neutralize the approaching $\ce{Na+}$ ions. Of course some $\ce{H2}$ bubbles are appearing on the cathode.
At the positive electrode (anode), the following reaction happens $$\ce{2 H2O -&gt;  O2 + 4 H+ + 4 e-}$$ and the $\ce{H+}$ ions neutralize the approaching $\ce{SO4^{2-}}$ ions. Of course some $\ce{O2}$ bubbles are produced on the anode. Half as much as $\ce{H2}$, because $4$ e- produce $1$ $\ce{O2}$ and $2 \ce{H2}$
To summarize, electrolyzing a $\ce{Na2SO4}$ aqueous solution will produce $\ce{H2}$ and a solution of $\ce{NaOH}$ at the cathode. And it will produce $\ce{O2}$ plus a solution of $\ce{H2SO4}$ at the cathode.
Now if the anodic solution is stirred and mixed with the cathodic solution, the following reaction happens $$\ce{H2SO4 + 2 NaOH -&gt; Na2SO4 + 2 H2O}$$ As a consequence, $\ce{Na2SO4}$ is regenerated, and the only chemical that is consumed in the whole process is water. The only product getting out of the whole process is the formation of $\ce{H2}$ at the cathode and $\ce{O2}$ at the anode.