To some who were confident of their own righteousness and looked down on everybody else, Jesus told this parable:

“Two men went up to the temple to pray, one a Pharisee and the other a tax collector.

The Pharisee stood up and prayed about himself:
God, I thank you that I am not like other men – robbers, evildoers, adulterers – or even like this tax collector. I fast twice a week and give a tenth of all I get.’

But the tax collector stood at a distance.
He would not even look up to heaven, but beat his breast and said, ‘God, have mercy on me, a sinner.’

I tell you that this man, rather than the other, went home justified before God. “For everyone who exalts himself will be humbled, and he who humbles himself will be exalted.”

[Luke 18:9-14]