When Jesus says “judge not” in Matthew 7, He gives the log-and-speck illustration, which assumes you’ll help with the speck, after some self-examination. Paul’s “be angry and don’t sin” in Ephesians 4 works the same way. He adds “don’t let the sun go down on your anger” because anger held overnight becomes a foothold.
Righteous anger grieves over real wrong, like Jesus at the temple. Sinful anger defends my ego and demands its own way. The verse that convicts me most here is James 1:20: “the anger of man doesn’t produce the righteousness of God.”
When I catch myself judging someone harshly, a flash of temper follows within seconds, because both come from the same place: putting myself in God’s seat. What helps is asking, “Am I grieved by this, or just offended?” Grief leads me to pray for the person, and offense leads me to condemn them.
Scripture does call us to discernment (like this one). 1 Corinthians 5 even commands the church to address sin, but with restoration as the goal, Galatians 6:1 says “in a spirit of gentleness.”