17 Elijah was a man just like us. He prayed earnestly that it would not rain, and it did not rain on the land for three and a half years. 18Again he prayed, and the heavens gave rain, and the earth produced its crops.
James offers a physical reminder of the power of prayer. The idea is that if Elijah was just a regular person like us and God responded in such a tremendous way to answer his prayers, God will respond likewise to answer our prayers.
When we go to God in prayer whether it is in a time of trouble, in a time of joy, in a time of physical need, or a time of spiritual need we should expect God to answer us.
These verses must be taken along with the previous verses from James 5. For a prayer to be effective, it must be done in faith. Likewise, a prayer of faith is going to be focused on what God desires and not simply what we desire, even if it is a proper thing to ask for in prayer.
While we tend to focus on the physical, the spiritual is of greater concern to God. With these things in mind though, we can approach God boldly in prayer and expect Him to great things like He accomplished through Elijah.