John 16.23-24: “Truly, truly, I say to you, whatever you ask of the Father in my name, he will give it to you. Until now you have asked nothing in my name. Ask and you will receive, that your joy may be full.”
The key seems to be “until now” you have not asked in my name. It is because only now is the gospel being fulfilled. But now, Jesus has purchased EVERYTHING necessary for the joy of the believer. That means if we pray for something and do not get, it was not necessary for our joy.
John 16.26: “In that day you will ask in my name, and I do not say to you that I will ask the Father on your behalf; for the Father himself loves you, because you have loved me and have believed that I came from God.”
Prayer is also our opportunity to have direct access to the Father through Christ and experience his Fatherly love for us in His responses.
My point from John 14, 15, and 16 is that these “whatever you ask in my name” passages are not for us to think that we must be doing something wrong if we are living godly lives, and yet God will not take the cancer away, or bring a spouse, or prevent tragedy. If I put all the passages together, prayer according to Jesus is ‘asking the Father for help in bearing fruits of obedience, so that the Son may bring glory to the Father, and so that we might have our joy complete and experience the direct love of the Father.’ And it seems if that is one of the main ways we pray, our prayers will be ultra successful (John 15.16)!