The question was asked, Does God answer all of our prayers? The answer is yes, though His answer is not always yes.
Sometimes the answer to prayer is no, but a no from God is not a rejection but rather a redirection.
A no from God is actually a yes to something better, something that we have not quite grasped.
A no from God is often a doorway to a learning experience from Him, if we are willing to walk through that door. On the other side of that door is growth, revelation, and peace.
On the other hand, sometimes the answers to our prayers are quite unexpected. Do you think Joseph Smith expected to see God the Father and Jesus Christ in the grove when he asked which church to join (see Joseph Smith—History 1:1-20)? Sometimes we get far more of an answer than we hoped for or imagined possible.
Sometimes an answer to our deepest needs come unexpectedly, in response to someone else’s prayer. Think of the angel visiting Alma the Younger and the sons of Mosiah (see Mosiah 27), an answer to the prayer of Alma’s father. At times, “the gifts and calling of God are without repentance” (see Romans 11:29), as we see in the case of Alma or Saul (see Acts 9).
We can help answer our own prayers simply by making better choices, by following a higher path than the one we’ve been plodding. Blessings from God are contingent on obedience to law (see D&C 130:20–21). It behooves us to learn what those laws are.
Whether yes or no, when the Lord answers our prayers or the prayers of another in our behalf, the answer will be right. You can rely on that.