It is recommended to comfort the family of the dead person with consoling words that would soothe the grieving relatives and reduce their sadness. The prophet Muhammad (S.A.W.) said: “Surely, every believer who comforts his brother at a time of grief will be dressed with the garments of dignity on the Day of Judgment.” [A good Hadith reported by Imams Ibn Majah and Al-Baihaqui]
It is better to stick to the words that the prophet Muhammad (S.A.W.) used in such occasions. when the prophet’s daughter called upon him to come because a son of hers had died, he sent his greeting (Salam) followed by:” It is His What He has taken, and it is His what He has given, and everything in His possession has a prescribed lifetime, so let her be patient and content (with Allah’s will and reward.” [Reported by Imam Bukhari]