The Bible does NOT say that the effective, fervent prayer of a SELF-righteous man avails much. The Scripture [James 5:16] uses the word "righteous" and there is a huge distinction between the righteousness of God and our own righteousness. In fact, different versions of the Bible liken our own righteousness to filthy or grease-stained rags, even a polluted garment. [Isaiah 64:6]
Prayer is not a magic wand, a manipulative tool, or a weapon disguised as Christian love. Genuine prayer requires seeking and knowing the heart of God concerning any "thing" and allowing His heart to shape our viewpoint and petitions.