We've all heard this before in some form or another, perhaps best know by Confucius having said "when we see a man of contrary character we should turn inwards and examine ourselves." It can be used as a meditation; a means of self-reflection as Confucius suggests. This can be a rather insightful practice. Why am I bothered by what this person is doing? Is it because I do this same thing and I don't like it about myself? This goes back to the biblical saying "judge not lest ye be judged."
When I find that I am being judgmental of someone because I see something in them that I don't like about myself, hopefully I can then offer them compassion and understanding instead of harsh judgment and irritation. Carl G. Jung says "If there is anything we wish to change in [someone else], we should first examine and see whether it is not something that could better be changed in ourselves."
This may not always be the case. Maybe I don't see that it's something that could better be changed in me. In taking the time to reflect, however, I may begin to understand that being critical of this person's actions only serves to irritate me and cause me suffering. In this situation, it may be best to accept what is and let go.
Ultimately, I think Gandhi had it right when he said to "be the change you wish to see in the world." I believe this is message offered by Swami Parjnanpad.