Ahmad and Muslim reported from Umm Salmah that she said: “I heard the Prophet, peace be upon him, saying: “If a servant of Allah is afflicted with a misfortune and says: Inna lillahi wa inna ilayhi raji’un, Allahumma ajirni fi musibati wa akhlif li khairan minha ‘Verily we belong to Allah and truly to Him shall we return. O Allah! Protect me in this calamity that has befallen me and replace it with something better,’ Allah will accept his prayer, grant him reward for his affliction, and replace it with something better.” She added: “When Abu Salmah (her husband) died, I invoked Allah in the words taught to me by the Prophet, peace be upon him, and Allah did grant me someone better than he, i.e., (He gave me) the Messenger of Allah (as a husband).”
Tirmizhi reports from Abu Musa al-Ash’ari that the Prophet, peace be upon him, said: “When a child of a servant of Allah passes away, Allah says to the angels: ‘Did you take the soul of My servant’s child?’ They say: ‘Yes.’ He, the Almighty, says: ‘Did you take away the apple of my servant’s eye?’ They say: ‘Yes.’ He, the Almighty says: ‘What did My servant say at this?’ They say: ‘He praised You and said: “Inna lillahi wa inna ilayhi raji’a un (V