In the title $R_{ab}$ is the usual Ricci curvature tensor and $S$ is the scalar curvature. As we are in a two dimensional Riemanian manifold with metric $g$, we can write $S= g^{11} R_{11} + g^{12} R_{12} + g^{21} R_{21} + g^{22} R_{22}$, where $g^{ij} = (g_{ij})^{-1}$.
I have read here that $g^{ik} g_{kj} = \delta_i^j$ where $\delta_i^j$ is the Kronecker delta function.
Again, because we are in two dimensions we really just need to compute $R_{12}=R_{21}, R_{11}$ and $R_{22}$. The first one is straightforward. If we see what we obtain on the right hand side of the equation in the title ($R_{ab} = \frac{1}{2} S g_{ab}$):
\begin{align*} \frac{1}{2} S g_{12} &= \frac{1}{2} (g^{11} R_{11} + g^{12} R_{12} + g^{21} R_{21} + g^{22} R_{22}) g_{12} \\ &= \frac{1}{2} (g^{11} R_{11} + 2g^{12} R_{12} + g^{22} R_{22}) g_{12} \\ &= \frac{1}{2} (g^{11} g_{12} R_{11} + 2g^{12} g_{12} R_{12} + g^{22} g_{21} R_{22}) \\ &= \frac{1}{2} ( 2g^{12} R_{12} g_{12}) = R_{12} \end{align*}
When dealing however with the remaining 2 I am not sure on how to deal with expressions like $g^{11} R_{11} g_{22}$. Any hints are indeed appreciated.
First the lazy way: Every two dimensional Riemannian space is an Einstein space. An Einstein space is characterized by the property that the Ricci tensor is proportional to the metric, $$ R_{hl}=\lambda g_{hl}\tag{1} $$
If we multiply $(1)$ by $g^{hl}$ we get $$R_{hl}g^{hl}=\lambda\delta^h_h\, \rightarrow \lambda=\frac{S}{n}\rightarrow R_{hl}=\frac{S}{2}g_{hl}\blacksquare$$
The above approach may, with some justification, be criticized on grounds of being somewhat circular since we assumed familiarity with the concept of an Einstein space. Lets try a more rigorous line of reasoning.
The Ricci tensor is defined by contraction of the curvature tensor
$$R_{lh}=R_{l\,\,\,hj}^{\,\,j}=g^{pj}R_{lphj}$$
When $n=2$ this is (a summation over $\{p,j\}=\{1,2\}$)
$$R_{lh}=g^{11}R_{l1h1}+g^{21}R_{l2h1}+g^{12}R_{l1h2}+g^{22}R_{l2h2}$$ Before we continue we should also remember that the curvature tensor is skew-symmetric in the first two indices as well as in the last two indices, $R_{lmhk}=-R_{lmkh}$ and $R_{lmhk}=-R_{mlhk}$. Now it is a pleasant task to calculate $R_{11},R_{12}$ and $R_{22}$
$$R_{11}=g^{11}R_{1111}+g^{21}R_{1211}+g^{12}R_{1112}+g^{22}R_{1212}=g^{22}R_{1212}$$ Similar calculations give $$R_{12}=R_{21}=-g^{21}R_{1212},\quad R_{22}=g^{11}R_{1212}$$
Notice that $R_{1212}$ is all we need! Before we take the next step we interrupt the broadcast to remind the reader that
$$g^{hj}=\left( \begin{array}{cc} g^{11} & g^{12} \\ g^{21} & g^{22} \\ \end{array} \right)=\frac{1}{\det(g_{lk})}\left( \begin{array}{cc} g_{22} & -g_{12} \\ -g_{21} & g_{11} \\ \end{array}\right)\tag{2} $$
Apparently $R_{hj}$ is equivalent to $$R_{hj}=g_{hj}\frac{R_{1212}}{\det(g_{lk})}$$
Which is indeed consistent with the definition of an Einstein space. Using the familiar pattern of the determinant we also notice that
$$S=g^{11}R_{11}+2g^{12}R_{12}+g^{22}R_{22}=(2g^{11}g^{22}-2g^{12}g^{12})R_{1212}=$$ $$=2\det (g^{hj})R_{1212}=2\frac{R_{1212}}{\det(g_{hj})}\tag{3}$$
Finally, solving $(3)$ for $R_{1212}$ we conclude that $$R_{hj}=g_{hj}\frac{R_{1212}}{\det(g_{lk})}=\frac{1}{2}Sg_{hj}$$