"Ask, and ye shall receive," the scriptures teach us, yet we have all prayed for things that have not come to pass. Many a sermon has been given on why our prayers are not always answered. But James puts it as succinctly as this: "Ye ask, and receive not, because ye ask amiss." (James 4:3) I believe, as it is possible to pray "amiss," it is also possible to pray correctly, in the true order of prayer, in a way that these prayers are always fulfilled.
The best example we have of this type of prayer is Nephi, the son of Nephi, who later became one of the disciples of Christ when he appeared to the remnant of Israel on the American continent. Nephi was a prophet and missionary who preached the word with unwearyingness. He sought God's will and to keep his commandments, and thus received the promise that "all things shall be done unto thee according to thy word," or in other words, all his prayers would come to pass. The Lord told him why this should be so--"for thou shalt not ask that which is contrary to my will." Nephi had reached the point where his prayers had become united with the mind of God and when he prayed, he did it with great power.
The true order of prayer is communication with our Father in Heaven which is dictated by the Spirit. This principle is taught throughout the scriptures. Paul explains in Romans 8:26-27 that the Spirit can help us to pray in the true order in spite of our human frailties. For we do not know how to pray as we ought, but if we listen to the Spirit it can make intercession for us. The prayer dictated by the Spirit to the saints in this way will be according to the will of God. D&C 46:30 tells us "he that asketh in the Spirit asketh according to the will of God, wherefore it is done even as he asketh."
Nephi's associates and fellow disciples learned from the Savior himself how to pray this way. When Jesus was among the Nephites he prayed an intercessory prayer to the Father in behalf of his followers. He asked that they might learn to be as united with him as he was with the Father--that they might be as one. Then he approached the disciples and saw that they had indeed learned the principle: "they did still continue, without ceasing, to pray unto him; and they did not multiply many words, for it was given unto them what they should pray, and they were filled with desire." (3 Nephi 19:23-24)
Praying without ceasing is thus seen to be a uniting of the human will to that of Christ and the Father. It is not necessarily many words which are said. In fact, prayers are often expressed in "groanings which cannot be uttered." Often vocal prayers which are expressed in the language of the spoken word are limited in conveying the true intent of the heart. However, the soul can be continually open to what is given by the Spirit. 2 Nephi 32 is a discourse upon the true order of prayer. It describes how the Holy Ghost teaches people to speak with the tongue of angels, or in other words, to speak the words of Christ. This chapter exhorts us to "hearken unto the Spirit which teacheth a man to pray." Finally in verse 9 we are that we must pray always and not faint, not performing anything unto the Lord until we are united with him in his will.
When we have learned to pray this way, our prayers will have great power. However, having our prayers come to pass is only a small benefit of learning this skill. The purpose of the true order of prayer is to teach us one of the most important things we can learn in our mortal existence. As we learn to pray in the true order of prayer, we are taught personal revelation. We are taught to converse with the Lord through the veil of mortality, as a preparation to one day enter his presence.