God knows well the heart and made provision for this sin of pride when He instructed the Israelites about appointing a king. He was to make a copy of the law. This would be the antidote, necessary for him and likewise for all of us (for "law" read "Word").
...The attempt itself to keep the commandments, one by one and day after day, will be sufficient to humble us, for the "straightedge of the law" (Rom. 3:20 JBP) will only show us, as Paul found, how crooked we are. We will find, in fact, that we cannot keep it. "The whole matter is on a different plane--believing instead of achieving" (Rom. 3:27 JBP). Pride won't find much foothold on that plane.
"The real test of being in the presence of God is that you either forget about yourself altogether or see yourself as a small, dirty object. It is better to forget about yourself altogether" (C. S. Lewis, Mere Christianity).
~ Elisabeth Elliot
When he [the king] takes the throne of his kingdom, he is to write for himself on a scroll a copy of this law, taken from that of the priests, who are Levites. It is to be with him, and he is to read it all the days of his life so that he may learn to revere the Lord his God and follow carefully all the words of this law and these decrees and not consider himself better than his brothers and turn from the law to the right or to the left.
~ Deuteronomy 17:19-20