One of the occasions in which the du’a of a person is answered is after a calamity has befallen them. However, it is necessary that the person display patience and satisfaction at Allah’s decree, and not wail or lament their misfortune.
Umm Salamah narrated that the Prophet, peace and blessings of Allah be upon him, said:
“There is no Muslim that is afflicted with a calamity, and he says what Allah has commanded him to say: ‘To Allah we belong and to Him we will return! O Allah! Give me the rewards (of being patient over) this calamity, and grant me something better to replace it,’ except that Allah will give him something better to replace it.”
Umm Salamah said, “So when (my husband) Abu Salamah died, I said this du’a, but could not help thinking, ‘Who is better than Abu Salamah?’ Then the Prophet, peace be upon him, himself sent me a messenger proposing marriage to me, so Allah blessed me with someone better than Abu Salamah.” (Recorded in Muslim)