God looks at the heart
Confess your sins to each other and pray for each other so that you may be healed. The earnest prayer of a righteous person has great power and produces wonderful results. Elijah was as human as we are, and yet when he prayed earnestly that no rain would fall, none fell for three and a half years! Then, when he prayed again, the sky sent down rain and the earth began to yield its crops. James 5:16-18 NLT
From the text, James is not providing a blanket formula for healing the sick. In my years in the pastoral ministry, I have seen how God healed a person who was prayed for. But there are also some occasions where the illness was not healed and the person prayed for was called home. The healing that James mentioned was not only about physical healing but also spiritual restoration. His words remind us that Christians will still be susceptible to commit sin. We sin against God and to one another. When this happens, we should confess our sin immediately. If we have committed a secret sin, we have to confess it to God directly. If we sin offending someone, we have to ask God and that person we wronged to forgive us. If we have committed sin publicly, then we should ask God to forgive us and have a public confession. Also, if someone approached us asking for forgiveness, we should be willing to grant it. In this way, we can be reconciled and restored, thus we are healed. Then it follows that when we are restored before God, “The earnest prayer of a righteous person has great power and produces wonderful results” (James 5:16). James emphasizes in this book the importance of prayer and unconfessed sin hinders our prayers. “If I had not confessed the sin in my heart, the Lord would not have listened” (Psalm 66:18). Elijah was an example of a person that offers a fervent prayer. Because of prayer, he was used by God to accomplished great things. Yet, we are reminded that Elijah is just like each and everyone of us. “Elijah was as human as we are” (James 5:17). It was not that Elijah was super human that he received the answers to his prayers but he is just a prayerful follower of God. The point here from these passages is that no matter what circumstance we are in, do not neglect to pray. Let us also make sure that when we are praying it comes from a sincere heart and not just mouthing words wanting to impress God. “When you pray, don’t babble on and on as the Gentiles do. They think their prayers are answered merely by repeating their words again and again” (Matthew 6:7).