"Judge not, that you be not judged." [Matt 7:1]
If there's one passage from the Bible that unbelievers know, it's Matt 7:1 about judging, and usually just the first two words. They usually bring it up during conversations about moral and immoral behavior because it's easier to tell others to stop judging you than it is to give a defense for your actions. But do they have a point? Is it wrong for a Christian to confront others about sin in their lives?
The English word "judge" used in Matt 7:1 means to "form an opinion or conclusion about." The word can also be translated "condemn". It means to sit in the judgement seat and reach a conclusion about someone else. There is only one who has that authority to judge, and that is Christ [John 5:22].
However, John 7:24 tells us "Do not judge according to appearance, but judge with righteous judgement." In other words, there is a right way to judge, according the Christ. So how do we make the distinction?
They way that I interpret Matt 7:1 is "Do not be judgmental." That is, do not say "he's a bad person and deserves to go to hell" because of the sin in his life. After all, all have sinned and fall short of the glory of God [Rom 3:23]. This is why in the same context Christ warns against pointing out the spec in your brother's eye while you have a plank sticking out of your own.
However, it is okay to express concern for another's soul. The Bible makes a clear distinction between sin and righteousness. Some things are just clearly wrong, like adultery, fornication, lewdness, hatred, jealousy, murder, etc. [Gal 5:19-21], and it is not judgmental to warn others about the dangers of these sins. Nor is it judgmental to confront someone and say "what you did the other day was wrong." You are simply stating a truth and trying to help that person get right with God.
Let your judgement be righteous and out of concern for another's soul, not simply to win a debate or feel better than someone else.