Trusting in one’s self-righteousness is a constant temptation. The gospel is really humbling. It’s saying that we are justified, we are reckoned righteous in God’s sight without any contribution of our own. There is an old hymn that says:
Cast your deadly “doing” down—
Down at Jesus’ feet;
Stand in Him, in Him alone,
One thing we need to do is preach the gospel to ourselves every day. Every morning we should remind ourselves, “What is the nature of my standing in relationship with God, and how is that so?” We need to remind ourselves of justification by faith alone apart from the works of the law.
Self-righteousness is a constant struggle because it is against our instincts to make ourselves nothing in the sight of God. We want some of the praise for our salvation.