The prayer of a person in right relationship with God is effective
James 5:16–18 (ASV 1901)
16Confess therefore your sins one to another, and pray one for another, that ye may be healed. The supplication of a righteous man availeth much in its working. 17Elijah was a man of like passions with us, and he prayed fervently that it might not rain; and it rained not on the earth for three years and six months. 18And he prayed again; and the heaven gave rain, and the earth brought forth her fruit.