Balancing Oxidation-Reduction equations
It is not entirely inconceivable that a Galvanic cell could be created with an acidic anode and basic cathode.  Having both half-reactions occurring in the same beaker, however, is unlikely.  That has implications when determining the thermodynamics (cell potential) of the reaction but not in balancing the half reactions.  Given:
$$\begin{align} 
\ce{2 H2O_{(l)} &amp; -&gt; O2 + 4 H+_{(aq)} + 4e^-} \tag{1}\\
\ce{ 2 H2O_{(l)} + 2 e- &amp; -&gt; H2_{(g)} + 2 OH-_{(aq)}} \tag{2}
\end{align}
$$

Multiply equation 2 by 2 and add:

$$\begin{align} 
\ce{2 H2O_{(l)} &amp; -&gt; O2 + 4 H+_{(aq)} + 4e^-} \tag{3}\\
\ce{4 H2O_{(l)} + 4 e- &amp; -&gt; 2 H2_{(g)} + 4 OH-_{(aq)}} \tag{4} \\
\ce{6 H2O_{(l)} + 4 e- &amp; -&gt; O2 + 2 H2 + 4 H+ + 4 OH- + 4 e^-} \tag{5}
\end{align}
$$

The key here is that the  $\ce{4H+ + 4OH-}$ showing up on the same side equation 5 will yield $\ce{4H2O}$.  Combining acid and base (to make $\ce{4 H2O}$ on the product side) and canceling the $\ce{4e-}$ and $\ce{4 H2O}$ that occur on both sides of the chemical equation gives the desired equation.