Jesus said, “Do not judge” (Matthew 7:1). But Matthew 18:15-17 says we are to confront our brother when he sins. Doesn't this require judging?
Whenever we come across passages of Scripture that seem to contradict each other the first thing to do is read the verses in context. Context can alter how we understand individual words.
In Matthew 7:2-5 Jesus contextualizes His statement about judging in verse 1 by noting the absurdity of removing the speck from a brother's eye while having a log in one's own eye. The word picture helps portray how ridiculous such hypocrisy is.
Jesus was speaking against two things. First, He was telling us not to be censorious in our attitudes to others. “Censorious” means disapproving, hypercritical, and stern. Often Christians are accused of this attitude when speaking against something. It is not wrong to speak out against something wrong—Jesus did it all the time. But He was full of grace and truth when He did.
Second, Jesus was speaking against hypocrisy. He said we should refrain from judging others who commit the same sin we're engaging in or when we're sinning even worse than they are. For “with the judgment [we] pronounce [we] will be judged” (Matthew 7:2 ESV).
This exhortation is similar to the point made by the Apostle Paul when he asks, “Do you suppose, O man—you who judge those who practice such things and yet do them yourself—that you will escape the judgment of God?” (Romans 2:3). These verses are a warning against hypocrisy and, at the same time, an exhortation to right living.
Jesus was not teaching that judgments should never be made. We know this because other passages require making judgments in the sense of assessing, evaluating, and discerning.
Sometimes we need to make general judgments. Christians must “judge” to distinguish between good and evil. In Hebrews 5:14 we read, “But solid food is for the mature, who by constant use have trained themselves to distinguish good from evil” (NIV).
We are also to effectively guard our hearts against error and sin. “But people who aren't spiritual can't receive these truths from God's Spirit. It all sounds foolish to them and they can't understand it, for only those who are spiritual can understand what the Spirit means. Those who are spiritual can evaluate all things, but they themselves cannot be evaluated by others” (1 Corinthians 2:14-15).
Other times we must make specific judgments of the words and behaviours of people. There are a couple reasons for this.
First, it may need to be done with a view to righting wrongs. This is the idea in Matthew 18:15-17. If a believer sees another believer sinning, it is his Christian duty to examine himself first (Galatians 6:1), then lovingly, humbly, respectfully, and in a non-censorious way confront the person with the sin. This is not judging but rather pointing out the truth with a view to bringing repentance and restoration in the other person (James 5:20).
Specific judgments may also be necessary because Jesus commanded us to be fruit-testers of false teachers and any who come in the name of Christ but who, by their actions, deny Christ (Titus 1:16, Matthew 3:8). “Beware of false prophets, who come to you in sheep's clothing but inwardly are ravenous wolves. You will recognize them by their fruits” (Matthew 7:15-16 NASB).
I hope this helps.