Be righteous, in Christ. You are the righteousness of God in Christ. Jesus didn't fail and neither will you. To be righteous by what you do and not fail at it, is self-righteousness.
And yet it was the spirit that inspired the saying;
Romans 1:17For in the gospel the righteousness of God is revealed—a righteousness that is by faith from first to last, just as it is written: “
The righteous will live by faith.”
So if any attempt to be righteous is as you think "self-righteousness" then all the words given from OT to NT were given by self-righteous people apparently inspired by a self-righteous spirit;
Matt 5:48
Be ye therefore perfect, even as your Father which is in heaven is perfect.
1 Timothy 6:11 But you, man of God, flee from all this,
and pursue righteousness, godliness, faith, love, endurance and gentleness.
Galatians 6:9 Let us not become weary
in doing good, for at the proper time we will reap a harvest if we do not give up.
Titus 2:11-12 For the grace of God has appeared that offers salvation to all people.
It teaches us to say “No” to ungodliness and worldly passions, and to live self-controlled, upright and godly lives in this present age.
Isaiah 1:17
Learn to do right; seek justice. Defend the oppressed. Take up the cause of the fatherless; plead the case of the widow.
Matthew 5:10 Blessed are those who are
persecuted because of righteousness, for theirs is the kingdom of heaven.
Micah 6:8 He has shown you, O mortal, what is good.
And what does the Lord require of you?
To act justly and to love mercy and to walk humbly with your God.
1 Peter 2:24“He himself bore our sins” in his body on the cross, so that we might die to sins and
live for righteousness; “by his wounds you have been healed.”
Psalm 119:1 Blessed are those whose ways are blameless,
who walk according to the law of the Lord.
Romans 6:13 Do not offer any part of yourself to sin as an instrument of wickedness, but rather offer yourselves to God as those who have been brought from death to life;
and offer every part of yourself to him as an instrument of righteousness.
Habakkuk 2:4
“See, the enemy is puffed up; his desires are not upright—
but the righteous person will live by his faithfulness.”
Isaiah 55:7
Let the wicked forsake their ways and the unrighteous their thoughts. Let them turn to the Lord, and he will have mercy on them, and to our God, for he will freely pardon.
Yea apparently there is a whole lot of self-righteousness being taught in God's word... I wonder why they would do that if it is so wrong to try and be righteous? poor Job the self-righteous man too bad he won't get anywhere with that attitude.