Now, some of my readers will be ahead of the game from me on this point. It may seem like an obvious point, but it is not until one has experienced it.
The point is this: prayers are answered when these are in the Will of God. Prayers are not answered when these are not in the Divine Will.
Now, from all time, Divine Providence has seen our lives and known us. God has had us and our lives, our trials, failures, sins, successes in mind from all time.
So, when we pray, we are either praying in the Will of God or not.
How do we know if we are praying in the Divine Will? Simple, our prayers are answered.
Too simple for words---sometimes the answer is delayed. But, if the prayer is answered, it is because our wills have been in the Will of God.
God does not "change His mind" in prayer. If someone has cancer and we pray and that person is healed, that was in the Will of God. If someone has cancer and we pray and that person is not healed, that is also God's Will.
Too many people think that they can influence God. No, He puts both the will and the action in us.
When Christ states, "Ask and you shall receive", He specifically means that our good prayers said in conformity with God's Will are answered.
St. Thomas More must have prayed that he would not have to face death for his Faith. This was not to be so.
Here is an interesting site with the trial and his comments, as well as his death and comments.
He did tell us not to be afraid. http://law2.umkc.edu/faculty/projects/ftrials/more/moretrialreport.html