Indeed, Almighty Allah answers du`aa’ and decrees what is best for His servants.Yet, it should be clear that answering du`aa’ may come in one of the forms elaborated in the hadith of the Prophet (peace and blessings be upon him) as mentioned below.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: While it is true to say that Almighty Allah hears and answers prayers, it is not true that He answers each and every petition that we make exactly in the same way that we wish them to happen.
If this were to happen, then the world would be a chaotic place to live; for humans may pray for all kinds of things, which may appear reasonable to them when judged from their own purely subjective points of views, at a specific time or place. We can see the absurdity of this, when we reflect on our own past. Each of us may have had the experience of thinking and praying for something in the past, and we were distressed when it did not happen as we had prayed for. However, after years passed, we feel that it was not good for us after all. This is because now we have in our possession the facts that convince us of the futility of our earlier wishes and dreams. Therefore, while Almighty Allah answers prayers, we cannot assume that all of our prayers will materialize as we imagined or according to our own desires.
Almighty Allah answers prayers, but He alone knows what is good for us, for He has all the facts governing our lives—past, present and future, and thus, He alone knows what is good for us in an ultimate sense. Therefore, while assuring us that our prayers are heard by Almighty Allah, the Prophet (peace and blessings be upon him) taught us the following: “No Muslim shall pray to Allah for anything—other than that entails sins or severing ties of kinship—without Allah granting him one of three things by virtue of his/her prayer: He may grant what they pray for (if it is good for them); or keep them as a treasure to grant them in the next word, or by virtue of their prayer avert some calamities that are decreed to happen to them!” On hearing this, the Prophet’s companions, remarked, “In that case we will pray more and more! Then the Prophet (peace and blessings be upon him) replied, “Allah’s generosity is even more boundless!”
Therefore, prayers are always beneficial for us and we should pray unceasingly, regardless of whether a particular wish has been granted or not, for Almighty Allah alone knows what is in our best interests, and He always does what is best for His servants. We are therefore best advised to seek peace by submitting to His will; we may do so by reading and meditating upon the following prayer of our beloved Prophet (peace and blessings be upon him):
Allahumma ij`al lee nafsan mutma’innatan tu’minu bi liqa’ika, wa taqna`u bi `ata’ika wa tarda bi qada’ika wa takhshaka haqqa khashyatika
(O Allah, grant me a soul that firmly believes in meeting You, and is content with the provision You have apportioned me, and is satisfied with Your decree, and fears You as You ought to be feared.)