First by the Word
We can learn the will of God through His revealed Word. When anything is definitely promised in the Word of God, we know that it is His will to give that thing. If when I pray, I can find some definite promise of God’s Word and lay that promise before God, I know that He hears me, and if I know that He hears me, I know that I have the petition that I have asked of Him.
For example, when I pray for wisdom I know that it is the will of God to give me wisdom, for He says so in James 1:5: “But if any of you lacks wisdom, let him ask of God, who gives to all liberally and without reproach; and it will be given to him.” So when I ask for wisdom I know the prayer is heard, and that wisdom will be given me.
In the same way when I pray for the Holy Spirit I know from Luke 11:13 that it is God’s will, that my prayer is heard, and that I have the petition that I have asked of Him: ” If you then, being evil, know how to give good gifts to your children, how much more will your heavenly Father give the Holy Spirit to those who ask him?”
Here is one of the greatest secrets of prevailing prayer: To study the Word to find what God’s will is as revealed there in the promises, and then simply take these promises and spread them out before God in prayer with the absolutely unwavering expectation that He will do what He has promised in His Word.
By the Holy Spirit
But there is still another way in which we can know the will of God, that is, by the teaching of His Holy Spirit. There are many things we need from God which are not covered by any specific promise, but we are not left in ignorance of the will of God even then. In Romans 8:26-27 we are told, “In the same way, the Spirit also helps our weaknesses, for we don’t know how to pray as we ought. But the Spirit himself makes intercession for us with groanings which can’t be uttered. He who searches the hearts knows what is on the Spirit’s mind, because he makes intercession for the saints according to God.”
Here we are distinctly told that the Spirit of God prays in us, draws out our prayer, in line with God’s will. When we are led out by the Holy Spirit in any direction, to pray for any given thing, we can do it with confidence that it is God’s will.
There is no doubt there are many times when we do not know the will of God; and in all prayer submission to the excellent will of God should underlie it; but when we know God’s will we will have confidence and know that we have the petitions which we have asked of Him.