You’re Never a Failure When You Pray
The first part of Rav Miller’s answer is on the page “What Does It Mean to Call Out ‘In Truth’?” and this is how he finished it.
Q: Why are some people not healed, even though they ask Hashem every day for a refuah?
A: Now, there’s another point here. It says, “Hamelech ya’aneinu b’yom kareinu — The King answers us on the day that we call out” (Tehillim 20:10). That means there’s no such thing as your prayers not being answered. It says, “Ashirah laHashem ki gamal alai — I sing to Hashem because He has already bestowed it upon me” (Tehillim 13:6). You have to know that as soon as you pray, you’re already a lucky person. But sometimes the good fortune comes in ways that you don’t know about or you don’t want.
I’ll give you an example. Here’s a boy who needs an operation. Let’s say he has to have his appendix removed. The doctors are about to strap him onto the operating table, but this boy has other ideas. As soon as the doctor turns his back, he leaps off the table, streaks through the door, and is running down the street, straight to the candy store. Now he’s buying a big ice cream a mile high, walking in the street, licking it. That’s life! Who needs an operation when you can be licking ice cream? But then his father comes along, throws the ice cream into the gutter, and drags him straight back to the hospital. That’s going to save his life. He’ll be able to eat a lot of ice cream cones later in life because of that.
Hashem isn’t necessarily going to give us exactly what we want. We can’t write our own prescription. He knows better what’s good for us! But this you have to know — that your tefillah helped. You’re never a failure when you pray. Even the tzaddik who prayed and soon after that a misfortune came upon him, chalilah, should know that his prayers were answered. Maybe not the way he wanted.
However, you can never tell. Maybe Hashem is waiting for your prayers. Maybe He’ll say to you, “My boy, since you prayed to Me, I’m going to tell the doctors to take you off the operating table.” Then they’ll take a look at your chart and say, “It was a mistake. Wrong diagnosis. Off to the candy store you go!” It happens sometimes that way. Many times it’s a wrong diagnosis. Sometimes it’s a fatal disease and yet people survive. Doctors make mistakes — only, they rarely say so. … Sometimes the doctor says he’ll live only three more weeks, but he goes on living for another thirty years. It happens again and again. So keep praying, and Hashem might make that diagnosis turn out to be wrong.
From Rav Avigdor Miller on Tefillah (Judaica Press).