I John 5:14 Now this is the confidence that we have in Him, that if we ask anything according to His will, He hears us.
15 And if we know that He hears us, whatever we ask, we know that we have the petitions that we have asked of Him.
For us to be able to ask anything according to His will, we must be able to know His will. Where do we find His will? We find His will in His word through the revelation of the Holy Spirit. Our confidence in faith grows when we know His will. Is it God's will for us to know His Will? There are many verses that say so like this one:
Col 1:9 For this reason we also, since the day we heard it, do not cease to pray for you, and to ask that you may be filled with the knowledge of His will in all wisdom and spiritual understanding;
1Co 2:10 But God has revealed them to us through His Spirit. For the Spirit searches all things, yes, the deep things of God.
Someone who is filled with the Holy Spirit and inspired will know God's will from the Word and revelation of the Spirit. When that person prays he/she has confidence knowing that their prayer is heard because it is according to the will of God. A prayer that doesn't know God's will is a weak prayer not a prayer of faith (James 5:15) listen to this passage again:
Romans 8:26 Likewise the Spirit also helps in our weaknesses. For we do not know what we should pray for as we ought, but the Spirit Himself makes intercession for us with groaning which cannot be uttered (in ineligible speech).
27 Now He who searches the hearts knows what the mind of the Spirit is, because He makes intercession for the saints according to the will of God.
Our weakness is not knowing God's will or guessing or taking the position that God's will can't be known. The Holy Spirit is given to us to pray in the Spirit (tongues) because in our carnal state we are not aware or have embraced or accepted the revelation of His will yet. Sometimes this is because we are ignorant of the Word. Sometimes this is true because we are denying the straightforward sense of God's word due to conflicting experiences. Sometimes this true because we have been taught contradictory things. Nevertheless, this scriptures says that when the Holy Spirit prays with us it is according to the will of God! The Holy Spirit never prays outside of the will of God on our behalf.
One of the major reasons we have confidence when we've prayed according to His Will is because of His amazing grace. God's grace has already decided and accomplished His will on our behalf. In the cross the atonement fixed the sin problem and redeemed us from the curse of the law (Gal. 3:13). These are faith facts that have already been done. Furthermore, in giving us the Spirit of His Son (Gal. 4:6), we now have received what we asked for! We have been given all things that pertain to life and godliness in Christ Jesus (II Pet. 1:1-3). What we needed we have in Christ--He has helped us (II Cor. 6:2). When we pray (and often this means demand) anything according His will we have them simply because they have already been done and given. It is like going into a restaurant where the menu is already prepared and sitting down to order. Anything we order in the menu the waitress or waiter will hear us and bring to us in good time. We have confidence because it is already the will of the restaurant owner or manager that we order what's on the menu. They won't hear us when we order anything NOT on the menu. They hear our voices but they cannot respond because what we are asking for is not available (This is like praying amiss James 4:3).
If we can grasp how true and real this illustration is, then we are understanding the full meaning of I John 5:14 & 15. God can do the impossible but He won't violate His already predetermined will to do it. Therefore, we must know God's will and get in it. We must know what's on God's menu (His grace) which is already prepared and given on our behalf. When we pray we are actually demanding, ordering, calling for, and commanding His will done. None of these prayers are actually directed to God but in His hearing they are directed at the misaligned and cursed conditions around us. (Have you ever noticed that when we visit a restaurant we are called guests but when we make a choice its called an order?)
Jesus said, (John 14:14) "If you ask (call for) anything in My name, I will do it." That was what He said before He was crucified, dead, buried and risen from the dead. Now that "it is finished" all that we call for in His name is already provided. We must begin to realize that praying as in begging God to do things He's already done is ignoring so much that was already done--this is not faith this is misguided unbelief. From these verses we can establish this truth that faith knows God's will and declares; when we don't know we are in weakness. When we don't know God's will we are in doubt (James 1:5-8). Doubts receive nothing from the Lord any more than sitting in the restaurant and not placing an order because we are not sure what we want or what is on the menu.
Faith knows and declares; when we don't know we are in doubt...this is not where God wants us. God therefore has given us a Helper (John 14:26 & 15: 26) that when we don't know what to pray or how to pray, we pray in the Spirit (I Cor. 14:14).