When we judge others, we will be judged by the same standard. We need to follow God ourselves and do what is right. God will judge others by His law.
Now when James says not to judge, he is not saying that we aren’t supposed to confront others in their sin. It may be true that they are doing wrong things, and there may be an occasion when we need to confront them. This is explained in Matthew 18:15-17 and Titus 1:13, 2:15, and 3:10. Or we may need to warn others about evil behavior as described in Acts 20:31 and Colossians 1:28. This is for times when it is clear that a brother or sister is in sin, such as adultery, drunkenness, gossiping, stealing, etc. The Ten Commandments help us know those sins.
I believe James is telling us to watch how we judge others in the grey areas. Like how people dress, raise their children, use their idle time or find entertainment with media. Or maybe when we see someone with failing health or sudden dire circumstances like Job (Job 1, 22, 42). And we are tempted to blame their situation on their choices. We need to steer clear of making judgment calls and let God show them Himself. He is Lawgiver and Judge. The One who saves and destroys. Who sends to Heaven. And sends to Hell. This should make us want to fear and obey Him.
The point here is that we need to let our lips be guided by the law of kindness. How would you want to be treated? When you are tempted to be critical, think of something good to say about that person and will enhance your ability to follow God’s law of love. That’s God’s will for you.
James 4:11-12; Matthew 7:1-5; Matthew 18:15-17; Titus 1:13, 2:15, 3:10; Acts 20:31; Colossians 1:28; Job 1, 22, 42