From The Second Comforter, Chapter 5
Christ touched upon the subject of getting answers to inquiries. He taught us to “ask, and it shall be given you; seek, and ye shall find; knock, and it shall be opened. For every one that asketh receiveth; and he that seeketh findeth; and to him that knocketh it shall be opened.” (Matt. 7: 7–8.) Just before these promises about getting answers, He taught in the same sermon: “Blessed are they which do hunger and thirst after righteousness: for they shall be filled.” (Id., 5: 6.) There is a direct relationship between “hunger and thirsting” for an answer, and the required “desire” to receive an answer.
Once again, the Book of Mormon’s plain superiority in explaining these connections comes through. Alma the High Priest taught: “Behold, I say unto you they are made known unto me by the Holy Spirit of God. Behold, I have fasted and prayed many days that I might know these things of myself. And now I do know of myself that they are true; for the Lord God hath made them manifest unto me by his Holy Spirit; and this is the spirit of revelation which is in me.” (Alma 5: 46.) Here “fasting and praying for many days” is related to “the spirit of revelation which is in me.” The concept of “hungering and thirsting”72 and receiving answers to prayers are tied together here in a plain explanation of the path. When Alma the Younger met the Sons of Mosiah after years of separation, he observed: “They had waxed strong in the knowledge of the truth; for they were men of sound understanding and they had searched the scriptures diligently, that they might know the word of God. But this is not all; they had given themselves to much prayer, and fasting; therefore they had the spirit of prophecy, and the spirit of revelation, and when they taught they taught with power and authority of God.” (Id., 17:2–3.) This principle of asking and receiving on the one hand, and the spirit of prophecy and revelation on the other are directly related. Without an inquiry, you are not able to receive.
One brief comment on fasting: You may not be able to hunger and fast for many consecutive days. Not all of us are Gandhi. But if you reduce your caloric intake, live with “fasting” while still eating enough to subsist, you can subordinate the flesh to the spirit while still eating and maintaining health. And, most of all, you can do so without calling attention to yourself since fasting should always be a private matter. Sometimes it does take days to receive an answer. Do not abandon the powerful tool fasting can provide to you because you cannot fast for many consecutive days. Instead, “fast” while eating enough for subsistence, and you will find you can accomplish the same things without jeopardy to health. Many of us eat too much anyway, and reducing food may be a boon to physical as well as spiritual health. (Emphasis Added)
I wonder if this has anything to do with the revelation to Hyrum “he shall receive counsel from my servant Joseph, who shall show unto him the keys whereby he may ask and receive” (D&C 124:95)