As good children ask their parents only for what accords with the parents' will, or what the parents are gladly ready to give them, so true disciples of Christ, by grace children of God, must ask the heavenly Father only for what accords with His will and serves the glorification of His name.
"If you abide in Me, and My words abide in you, ask whatever you desire, and it shall be done for you" (Jn 15:7). In these words the Lord promises what is asked on this condition: that we remain faithful or obedient to His teaching.
So also John the Theologian says: when we ask anything according to His will, He hears us. This is the necessary condition: that we ask God according to His will, or in agreement with His will. That is, we must ask God only for those good things which He is pleased to grant us.
The Lord Himself indicated the chief objects of prayer in the prayer given to the disciples: "Our Father, who art in heaven, hallowed be Thy name," and so on (Mt 6:9ff.).
And when we know that He hears us in whatever we ask, we know also that we receive the things asked of Him. If we have such confidence that God attends to our prayers in every case, whatever we ask of Him, then we also have confidence that we shall receive from Him the request for which, in a definite case, we beseech Him.
From the general truth of God's favor toward those who ask, the Apostle draws a conclusion for particular cases of prayer concerning certain known needs. But in both cases, without doubt, the Apostle presupposes the necessary condition stated earlier: that we ask according to God's will, in agreement with divine teaching.