The one to whom that happens should believe that there is a reason and great wisdom behind the delay in the response. Allaah, may He be glorified, is the Sovereign of all and none can put back His bounty or overturn His ruling or object to His giving or His withholding, if He gives by His bounty or withholds by His justice. We are His slaves and He does with us whatever He will.
And your Lord creates whatsoever He wills and chooses, no choice have they (in any matter)
How can a slave fall short in honouring his master's rights and then demand his rights in full?
It is His right to be obeyed and not disobeyed, to be remembered and not forgotten, to be thanked and not to be shown ingratitude. If you look at yourself and how you are carrying out your duties, you would think very little of yourself and you would feel humility and would realize there can be no salvation except by His forgiveness and mercy. So look at yourself as being a slave, for Allaah is the Creator and Controller.
Allaah has great wisdom and He does not give or withhold except for a reason. You may look at something and think that it is good but by His wisdom He does not decree it. A doctor may do things which appear to be painful but they are in the patient's best interests. And for Allaah is the highest description. (cf. al-Nahl 16:60).
Attainting the thing asked for may cause hardship to the one who is asking. It was narrated from one of the salaf that he used to ask Allaah to let him go out on a military campaign, but a voice called out to him: If you go on a military campaign you will be taken prisoner, and if you are taken prisoner, you will become a Christian. Sayd al-Khaatir, 1/109
Ibn al-Qayyim said: Whatever Allaah has decreed for His believing slave is a blessing even if that is in the form of withholding; it is a favour even if that is in the form of a trial, and the calamity decreed by him is fair even if it us painful. Madaarij al-Saalikeen, 4/215.
No one knows how his affairs will end up. He may ask for something which leads to bad consequences, and may even harm him. The Controller knows best what is in his best interests. and it may be that you dislike a thing which is good for you [al-Baqarah 2:216]. One of the meanings of this verse is that we should not wish that the decree of our Lord was different or ask Him for things of which we have no knowledge, for perhaps that may harm us without us knowing. So we should not choose anything different than what our Lord has chosen for us, rather we should ask Him for a good end in what He has chosen for us, for there is nothing more beneficial for us than that.
What Allaah chooses for His slave is better for him that what he chooses for himself. Allaah is more merciful towards His slaves than they themselves or their mothers are. If something happens to them that they dislike, that is better for them than if it did not happen, so His decree is all kindness and mercy. If the slave submits to Allaah and has certain faith that all dominion belongs to Allaah and all things are under His command, and that He is more merciful to him than he is himself, then he will find peace of mind regardless of whether his need is met or not.
See Madaarij al-Saalikeen, 2/215
The response may be delayed because the person himself has done something which is an impediment to receiving a response or a cause of delay. Perhaps there is something haraam in his food, or perhaps there was some negligence in his heart at the time when he made the du'aa', or perhaps he had committed a sin, as a consequence of which his du'aa' was not answered. So when the response to the du'aa' is delayed, this may prompt the person to check on himself and examine how he stands before his Lord, so that he will take stock of himself and repent; if the answer to his prayer came sooner, perhaps he would become heedless and think that he was doing fine, then he would develop a sense of self-admiration that may lead to his doom.
Delay or withholding of a response may be because Allaah wants to delay the reward for him until the Day of Resurrection, or Allaah wants to divert an equivalent evil from him, but he does not realize that.
Whatever the case, the fruits of du'aa' are guaranteed, even if you do not see the response with your own eyes. So think well of your Lord and say: Perhaps He has answered me in a way that I do not know. It is narrated in a saheeh report that the Prophet (peace and blessings of Allaah be upon him) said: There is no Muslim who does not offer any du'aa' in which there is no sin or severing of family ties but Allaah will give him one of three things in return: either He will answer his du'aa' sooner, or he will store it up for him in the Hereafter, or He will divert an equivalent evil away from him because of it. They said: We will say a lot of du'aa'. He said: Allaah is more generous. Narrated by Ahmad, 10749. al-Albaani said in Saheeh al-Targheeb wa'l-Tarheeb: it is hasan saheeh.
In conclusion, there are many reasons why a du'aa' may not be answered or the answer may be delayed; we must ponder this and not stop making du'aa', for du'aa' will always be of benefit.
And Allaah knows best.
Reproduced from Islam QA