Russell's paradox deals with the set of all sets that do not contain themselves as a member of that set. It ask whether that set of all sets is also the member of the set or not.
The barber paradox states :Consider a collection of barbers in a city who shaves only those men who do not shave themselves.And the questions arises whether the barber shaves himself or not.And the answer to which comes as barber should shaves himself and also should not shave himself. I understood the barber paradox.
But how should we relate it to Russell's paradox, what is the set here to be considered that does not contain themselves.
thanks in advance
Russell forms the set $S=\{x \ |\ x\notin x\}$ and then proves that both $S\in S$ and $S\notin S$ are contradictory.
In the barber's paradox, take $S$ to be the set of men who are shaved by the (male) barber and then we see that the barber both must and cannot be in the set.
I'm not quite sure your description of the barber's paradox matches my understanding. To me, there is exactly one barber, who is male, and any number of other male people in the town. The barber shaves precisely the men who do not shave themselves.
If you want to be extremely literal about the mapping, let each man in the town be represented by a set, $x$, that contains precisely the people within the town that he shaves. (For uniqueness of each set, you might also want to add a unique identifying marker, like a number.) Let's call the barber's set representation $S$.
We are told that the barber shaves precisely the people who do not shave themselves i.e. the people who are not contained in their own set, so his set $S$ is precisely equal to $\{x\ |\ x\notin x\}$. Then the question "does the barber shave himself?" is precisely the question "does $S\in S$ hold?"