Jesus shared this familiar admonition in Matthew 7: "Judge not, that you be not judged. For with what judgment you judge, you will be judged; and with the measure you use, it will be measured back to you" (vv. 1-2).
Some people read these verses and say, "Christians are to make no critical evaluations of other people's lives whatsoever." But if that's what you believe this means, then, boy, will you have a problem with Jesus. Elsewhere, He actually commanded us to make evaluative, critical judgments, like in John 7, where He said, "Judge with righteous judgment" (v. 24).
So what did Jesus mean here when He said, "Don't judge"? He was speaking of a harsh, self-righteous, censorious judgment, a hypercritical evaluation that pretends to know the motive of a person but doesn't have all the facts.
There are three reasons we're not to judge in this way: First, because you're not the final judge; God is. Only He knows everything. Second, because judgment is a boomerang. "With what judgment you judge, you will be judged; and with the measure you use, it will be measured back to you" (v. 2; see also Judges 1:6-7; Esther 7:10). By which measure do you want God to judge you—justice or mercy? Which measure do you usually grab when you judge other people?
And third and finally, we're not to judge in this way because it's hypocrisy. "Why do you look at the speck in your brother's eye, but do not consider the plank in your own eye? Or how can you say to your brother, 'Let me remove the speck from your eye'; and look, a plank is in your own eye?" (vv. 3-4). In this illustration, the speck and the plank are essentially the same substance, which explains why it's often much easier to spot the sins that you struggle with in other people and judge them for it (see 2 Samuel 12:1-10).
So what are we to do instead of being censorious, hypocritical, smug, or self-righteous? We're to be helpful to our brothers and sisters. "Hypocrite! First remove the plank from your own eye, and then you will see clearly to remove the speck from your brother's eye" (v. 5). Humbling yourself and confessing your sin before God is the first step in helping restore other people (see Psalm 51:10-13).
But you also need discernment. "Do not give what is holy to the dogs; nor cast your pearls before swine, lest they trample them under their feet, and turn and tear you in pieces" (v. 6). You wouldn't give something holy to dogs. You wouldn't give a pearl necklace to a pig. So there's a balance. Jesus was basically saying, "Don't judge censoriously, self-righteously, or hypocritically. But be discerning."
On one occasion, Jesus referred to Herod as a fox—a sly, cunning, self-serving beast (see Luke 13:31-32). Jesus also called the Pharisees "whitewashed tombs" and a "brood of vipers" (see Matthew 23:27, 33). How do either of those instances fit into "Judge not, that you be not judged"? They fit perfectly; they were both righteous judgments, and Jesus was right on the mark.
So don't misunderstand this passage from Matthew 7. The balance you should aim for as a believer is to be loving, be forgiving, but by all means, be discerning.