It is difficult not to drift into a fatalistic view of prayer, where we no longer bother to pray since God has already determined everything that is going to happen. However, the following passage indicates that God acts upon the requests of his children, especially for those whose hands are clean and who are open and honest about their struggles.
Is anyone among you suffering? Let him pray. Is anyone cheerful? Let him sing praise. Is anyone among you sick? Let him call for the elders of the church, and let them pray over him, anointing him with oil in the name of the Lord. And the prayer of faith will save the one who is sick, and the Lord will raise him up. And if he has committed sins, he will be forgiven. Therefore, confess your sins to one another and pray for one another, that you may be healed. The prayer of a righteous person has great power as it is working. Elijah was a man with a nature like ours, and he prayed fervently that it might not rain, and for three years and six months it did not rain on the earth. Then he prayed again, and heaven gave rain, and the earth bore its fruit. – James 5:13-18
Hezekiah (one of Judah’s good kings) had an extra fifteen years added to his life as a result of prayer. How we live can help influence God’s answer to prayer. None of us are perfect though. Thankfully, we don’t need to rely on our own ability to live right to gain an audience with God. God attributes us with Jesus’ spotless righteousness when we put our trust in Christ, otherwise God would be deaf to our pleas because of our sins. The prayers of the saints will even somehow contribute to initiating God’s judgment on the great and final day.
Father, without Christ You would not hear us. Thanks that, in Jesus, we can approach You. Sorry for our rebellion against You. Give us the humility to make ourselves accountable to one another so You can return us to health. Even though You may not always heal us the way we want You have saved us, and we trust that You will raise us up as You did Christ. As we make efforts to reduce the impurity of our hearts, increase Your responsiveness to our requests.