Blessed [are] those who hunger and thirst for righteousness, For they shall be filled. Matthew 5:6 (NKJV)
There are two kinds of righteousness: Self-righteousness, and the Righteousness of God.
Self-righteousness is works righteousness; it is the righteousness of the law. It is trying to be made right by your efforts; it is seeking to be justified by keeping the law. It is trusting in oneself.
Luke 18:9-14 (NKJV) Also He spoke this parable to some who trusted in themselves that they were righteous, and despised others: “Two men went up to the temple to pray, one a Pharisee and the other a tax collector. The Pharisee stood and prayed thus with himself, ‘God, I thank You that I am not like other men—extortioners, unjust, adulterers, or even as this tax collector. I fast twice a week; I give tithes of all that I possess.’ And the tax collector, standing afar off, would not so much as raise [his] eyes to heaven, but beat his breast, saying, ‘God, be merciful to me a sinner!’ I tell you, this man went down to his house justified [rather] than the other; for everyone who exalts himself will be humbled, and he who humbles himself will be exalted.”
The Righteousness of God is His own Righteousness that He freely gives to us as a gift, we do not work for it, we receive it by Faith in Jesus. See-Romans 3:22 even the Righteousness of God, through Faith in Jesus Christ, to all and on all who believe. For there is no difference. This is the kind of Righteousness that God accepts.
To thirst for Righteousness doesn’t mean to just desire and strive to be and do right. It means coming to the realization that my own self efforts to be and do right are futile so I need the true Everlasting Righteousness that only Jesus provides so I give up trying to be and do right on my own and instead trust in Him as my Righteousness.
To thirst for Righteousness is to ditch my own striving to be made and to do right and receive the free gift of Righteousness through Faith in Jesus.