Matthew 21:18 In the morning, as he was returning to the city, he became hungry. 19 And seeing a fig tree by the wayside, he went to it and found nothing on it but only leaves. And he said to it, "May no fruit ever come from you again!" And the fig tree withered at once. 20 When the disciples saw it, they marveled, saying, "How did the fig tree wither at once?" 21 And Jesus answered them, "Truly, I say to you, if you have faith and do not doubt, you will not only do what has been done to the fig tree, but even if you say to this mountain, 'Be taken up and thrown into the sea,' it will happen. 22 And whatever you ask in prayer, you will receive, if you have faith."
To understand the message this passage of scripture speaks to us we need to know that Jesus only did His Father's will. To do His Father's will He needed to know what it was. John 14:10 tells us the Father who dwelled in Jesus did His works through Jesus. Jesus spoke only what His Father told Him to speak (John 12:49). Jesus did only what His Father commanded Him (John 14:31). When Jesus spoke and the fig tree withered at once, He was doing God's will. All Jesus says to His disciples is predicated on knowing and doing God's will.
Abraham knew God's promise to him was to be the father of many nations and that he and Sarah needed to have a child for that promise to be fulfilled. He had faith God was able to do what He promised even when both he and Sarah were beyond child bearing in years. He exercised faith in God ability to keep His promise and a child was born to Sarah and him (Romans 4:18-21). Faith believes God has the power to do His will. Abraham was not caused to doubt God even when the circumstances looked impossible from a human perspective.
Another key element in receiving what we ask in prayer is asking according to God's will. 1 John 5:14-15 instructs us that whatever we ask according to God's will we receive because He hears us. How do we know God's will? We know God's will because we have His written Word (1 Thessalonians 5:18; 2 Timothy 3:16). We know God's will by hearing the Holy Spirit within us (Acts 8:29-30). Ezekiel 36:27 and Ephesians 1:13-14 instruct us that the Holy Spirit in every believer will move them to do His will. We can pray with confidence for each believer stuck in sin to be moved out of their sin by the Holy Spirit. The Apostle prayed God's will for each believer. In Ephesians 1:15-20 he prayed for each believer to know the hope they have, the riches they have and the power they have. James instructed us to pray in faith for wisdom to go through trials that come upon us knowing it is God's will to give it to us James 1:5-6
We may not be led to dry up fig trees or have mountains move, but we are to pray for God's written word to be established in each believers life. We know this is God's will. We are to pray in faith. When we pray in faith, not doubting, we will receive what we ask. Trouble with knowing God's will? Be a diligent student of God's word. Trouble with little faith? Ask God to help your unbelief (Mark 9:24). Ask God to increase your faith (Luke 17:5). When the Holy Spirit prompts us to pray a certain way the prompting will never contradict God's written word.