Jared Wilson reflects on how one might become holy, without becoming proud of their holiness:
The answer is simple: By actually becoming holy, not just thinking we are.
Holiness and holier-than-thou-ness aren’t parallel phenomena. They run on different tracks. If someone is growing in arrogance, pride, and self-righteousness, by definition they are not growing in holiness.
The problem arises in equating holiness with religious behavior. Holy people do obey God, of course. But the character of holiness, in which the Spirit does his progressive sanctifying work in our hearts (and therefore in our thoughts, speech, and actions), produces qualities of humility, gentleness, kindness, and self-control. Any arrogant fool can abstain from certain sins or give to charity and what-not. The Pharisees certainly did that, and all our legalistic contemporaries do too. But that is not real holiness. That is moralistic separatism or some such thing.
Therefore, it is impossible to become both holy and holier-than-thou. To grow in one, is to atrophy in the other.
But I am grateful that while I still struggle with a variety of sins, most especially the root sin of pride, I have God’s promise that he will complete the work he began in me, and that Jesus is both the author and the perfecter of my faith.