Supplication is either accepted exactly as desired or what is better is granted.
For example, someone asks for a son and Almighty God bestows a daughter like Mary. One should not say that his supplication was not accepted, but that it was accepted in a better way.
Also, sometimes a person makes supplication for his happiness in this world and it is accepted for the hereafter. One should not say that his supplication was rejected, but that it was accepted in a better form. Similarly, Almighty God is All-Wise; we seek from Him and He responds to us. But He deals with us in accordance with His wisdom.
A sick person should not cast aspersions on his doctor’s wisdom. If he asks for honey and the expert doctor gives him quinine, he should not say: “The doctor didn’t listen to me.” For the doctor listened to his sighs and moans; he heard them and responded to them. He prescribed something better than what was asked for.
From Twenty-Fourth Letter by Master Said Nursi