I think that the idea is to have a predicate $S(x,y)$ to mean $x\text{ shaves } y$, so to say that $x$ shaves himself is to say $S(x,x)$. Of course we will also have a predicate $B(x)$ which says that $x$ is a barber.
Now you want to have a barber that shaves all those who do not shave themselves. Namely, someone which is a barber, and for every person who does not shave themselves, the barber shaves them. You also want that all the barbers for which this property holds, would shave themselves.
So we have: $\forall x\Big(\big(B(x)\land\forall y(\lnot S(y,y)\rightarrow S(x,y))\big)\rightarrow S(x,x)\Big)$
So we said that for any $x$, if $x$ is a barber, and whenever $y$ does not shave himself, then $x$ shaves $y$, then it follows that $x$ shaves himself.