They are NOT contradictory. Sadly, you, and SO many others, merely STOP at Matthew 7:1 and TOTALLY, and PURPOSELY, leave the remaining verses off. I quote from the article cited below to explain further...
When Jesus told us not to judge (Matthew 7:1), He was telling us not to judge hypocritically. Matthew 7:2-5 declares, "For in the same way you judge others, you will be judged, and with the measure you use, it will be measured to you. Why do you look at the speck of sawdust in your brother's eye and pay no attention to the plank in your own eye? How can you say to your brother, ‘Let me take the speck out of your eye’ when all the time there is a plank in your own eye? You hypocrite, first take the plank out of your own eye, and then you will see clearly to remove the speck from your brother's eye." What Jesus was condemning here was hypocritical, self-righteous judgments of others. ... We are to "judge" sin, but always with the goal of presenting the solution for sin and its consequences—the Lord Jesus Christ (John 14:6).
So, please, The Bible is to be taken as a WHOLE, not as bits and pieces! And people accuse Christians of picking and choosing!
Forgive others as I have forgiven you.
I’m not here to win a popularity contest, but to witness to and speak the TRUTH.