Psalm 119:22 Take away from me scorn and contempt, for I have kept your testimonies.
David asks for grace to be saved from ridicule and contempt. He obviously doesn't like to be looked down upon. He wants, as we all do, to be respected for who he is and for what he believes in. He knows of bitter experience, that it is not always so.
We can face scorn and contempt for at least two reasons. Atheists or people who hate God will despise those who believe in God. When we are God's friends, the world quickly becomes our enemy. When we love God and His words, we must expect to be mocked and ridiculed in various ways. We can carry this mockery with a raised head, for it is really directed at God. Then it is an honour for us to suffer for his name.
It is worse if the mockery happens to us because of our hypocrisy. We deserve contempt if we are not an honest believer and do not live to the best of our ability according to the word of God. We deserve scorn if we say something, but do something completely different. It is easy for people to expose hypocrisy and inconsistent confessions of faith.
When David prays that God will take away scorn and contempt from him, it is a prayer to be spared of hypocrisy and falsehood. He has a desire to be honest in truth and life. He has a desire to live to God's glory. He wants to live right.
In fact, he says: I have kept your testimonies. I take care of your commands! As far as he knows, he lives by the word of God. He finds joy in the law of the Lord. He meditates on God's commandments. He hide it in his heart, that he will not sin against the Lord. He longs for the Word and asks for insight and revelation. He wants to see the wonderful things in the Word of God. He loves the Word and keeps the commandments of the Lord. All this he said earlier in this psalm.
In other words, he lives with good conscience. He says that he does not deserve scorn and contempt. That's why he boldly prays this prayer: Take mockery and contempt away from me. When we live in good conscience in accordance with our Christian faith, which is grounded in the Word of God, we can pray bold prayers!