(related to Axiom: Schema of Separation Axioms (Restricted Principle of Comprehension))
It now time to demonstrate how the axiom of separation avoids the Russel's paradox. Recall that Cantors' naive set definition allowed the construction of a “set of all sets which do not contain themselves.” Formally, using the set-builder notation, we could write $$Y:=\{z\mid z\text{ is a set and } z\not\in z\}.$$
The Russel's paradox was that
$$\begin{array}{rrcll}
\text{if}&Y\in Y&\text{then}&Y\text{ is a set and }Y\not\in Y&\text{which is false, since }Y\in Y,\\
\text{if}&Y\not\in Y&\text{then}& Y\text{ is not a set or }Y\in Y&\text{which is false, since }Y\text{ is a set.}\end{array}$$
Therefore, altogether it led to a contradiction.
With the axiom of separation, this cannot happen anymore. Now, the elements $z\in Y$ can only be taken from an existing set $X$. In comparison to the general axiom of comprehension, where $Y$ could become anything, with the axiom of separation $Y$ becomes a subset of an existing set $X$. Using the set-builder notation, we can now write $$Y:=\{z\in X\mid z\not\in z\}=\{z\mid z\in X\text{ and } z\not\in z\}.$$
Now,
$$\begin{array}{rrcll}
\text{if}&Y\in Y&\text{then}&Y\in X\text{ and }Y\not\in Y&\text{which is false, since }Y\in Y,\\
\text{if}&Y\not\in Y&\text{then}& Y\not\in X\text{ or }Y\in Y&\text{which is true only for }Y\not\in X.\end{array}$$
Thus, the definition is not contradictory anymore and everything is alright.
Proofs: 1