Jesus twice explained the ability of those who in prayer ask God for something and they will receive it. Of course these statements have been discussed many times. In fact, as time goes on, modern people have less and less understanding of what Jesus promises and delivers rather than having more and more faith or scholarly based understanding. Further, when someone "prays for something" and "does not get it," they use these powerful statements of truth and faith in the One God to question God's reliability, constancy, power, mercy and even his existence... and even go so far as to cast doubt on Jesus. This is unacceptable. If generations of unlettered and unschooled people who lived in great poverty understood what Jesus said (and the Apostles explained, in general, in the writings of the New Testament), there is no excuse for not understanding in these modern times. Further, there is no reason for the clergy to be on the defensive and abashed when challenged by someone who "prayed for something" and "did not receive it."
So instead of wading through the scripture and explaining it (following the routes of many who do indeed "get" it) definitively, I have (yes!) an analogy, made for just the modern person, especially the young people (hi there, have not forgotten you at all). So I've going to reverse order this time by giving you the analogy first, and then the scriptures.
A man lives in a small town, in a remote area, so there are no other towns or cities nearby at all. There is only one bank in town and knowing that there are no other sources of loans, the bank has a sign on the front of the building saying "No request for a loan will be turned down."
This man needs a new plow for his field, so he goes to the bank and asks for a loan. With a smiling face and much genuine graciousness the bank officer gives to him the loan, right on the spot. Instead of looking happy, though, the man looks puzzled and alarmed as he stares at the money in his hand. The officer asks him, "What is the matter?" The man replies, "You gave me the money in our local currency!"
The officer is astonished because she replies, "What else would we have to give to you?" The man then petulantly says, "I did not plan to buy this plow locally! I planned to use a mail order to a foreign land and thus I need their currency!"
Thus the man received his loan as promised, in good faith, by the bank, but he refused to use it.
Well, what have we here? We have a bank, in this analogy, that in fullness of generosity far beyond "business sense" or "economics" gives in immediate cash loans to anyone of the residents of this small town and remote region who make his or her way to their door and asks. So the bank is not only blameless but generous beyond understanding. Everyone in the area not only understands what a gift this bank's attitude, policy and gift is, but glorifies it (I bet that bank receives some nice gifts of fruit baskets left at their door!)
Yet we have a man who is so wrapped up in his own desires that he can live there and understand how generous the bank is and then still be astonished when they cannot accommodate him in a secular theoretical matter far from their given generosity. He thinks this small poor bank is like a magic box that can read his mind and have "voila!" the foreign currency waiting for him so he can not patronize the local merchants (his own family, neighbors and community) so he can mail away and "give the business" to some unknown land.
This is how you must understand asking God for anything. You are entering "God's bank" and "God's kingdom" when you enter his bank of prayer. This is why Jesus each time says one must ask "in prayer." Prayer is not a magic formula, a ritual that one must say aloud or think in organized thoughts to God because "that's how it works" and "that's how God knows what you are asking for." Prayer means you have accepted being a resident of the kingdom of God. As a resident of the kingdom of God you are only asking for what God in his perfect generosity knows is good for you and most important of all, good for humanity's participation in God's kingdom. Needless to say, it is an obvious egregious mistake to ask God for anything that is counter to being in communion with God as a believer. But this is also why you cannot ask in "good faith" many things of God and expect to receive in the way you expect. You see, even if you "believe" and ask in "good faith," if your asking is a form of "testing God," as the analogy man did, you demonstrate that your desire may be to be of the kingdom of God, but you are not in your mind and heart really there.
Understand the correct mindset by reading this:
And on being asked by the Pharisees, "When is the kingdom of God coming?" he answered and said to them, "The kingdom of God comes unawares. Neither will they say, 'Behold, here it is," or 'Behold, there it is.' For behold, the kingdom of God is within you."
Now, notice that Jesus is not speaking of either 1) the end of times (for the Pharisees were asking when God will rule the world in justice, not when the world will end in final judgment) nor 2) of God himself literally living like some pagan spirit within a person (for many unbelievers think that they command "powers" because they have "a part of God within them." What Jesus is making clear is that everyone shares in making on earth the reality of the kingdom of God "within" them and, further, the kingdom of God creeps unseen within someone's heart because it is not achieved by works but by grace and faith.
So now that you understand that in my analogy the bank and the small remote region are like the kingdom of God as Jesus explains it in Luke 17:20-21, now I will close this message with the two scriptures that are those where Jesus promises the answer to prayer.
And I say to you, ask and it shall be given to you; seek, and you shall find; knock, and it shall be opened to you. For everyone who asks receives; and he who seeks finds; and to him who knocks it shall be opened. But if one of you asks his father for a loaf, will he hand him a stone? or for a fish hand him a serpent? or if he asks for an egg, will he hand him a scorpion? Therefore, if you, evil as you are, know how to give good gifts to your children, how much more will your heavenly Father give the Good Spirit to those who ask him!"
But Jesus answered and said to them, "Amen I say to you, if you have faith and do not waver, not only will you do what I have done to the fig tree, but even if you shall say to this mountain, 'Arise, and hurl thyself into the sea,' it shall be done. And all things whatever you ask for in prayer, believing, you shall receive."
Jesus also refers to the Second Coming and his return, when all who are worthy and thus in God's book of life will be fully in the Kingdom of God and thus can ask for anything but will not need to as they will already have all of God's goodness.
And you therefore have sorrow now; but I will see you again, and your heart shall rejoice, and your joy no one shall take from you. And in that day you shall ask me nothing. Amen, amen I say to you, if you ask the Father anything in my name, he will give it to you. Hitherto you have not asked anything in my name. Ask, and you shall receive, that your joy may be full.