As salaamu alaikum.
What exactly should we muslims do and say when we hear that a muslim /muslimah has left this world, besides saying “inna lillalhi wa inna ilaihi rajeun”? In what ways/words can we console the parents or husband or wife or children of the deceased?
Answer: [By Dr. Manzur-e-Ilahi]
Praise be to Allah.
You can also say GafarAllahu and Rahimahullah OR GafarAllaha and Rahimahallah upon hearing the news, depending on whether the deceased is a male OR female.
Also please see the following excerpt from Islam Q-A:
It is prescribed in Islam to offer condolences to the family of the deceased. This should take the form of whatever is thought will bring them consolation, stem their grief and help them to be patient. Condolences should be offered in the manner reported from the Prophet (peace and blessings of Allaah be upon him) if one can remember that, otherwise in whatever good words come easily to one which will achieve the same purpose and which do not go against Islam. It was narrated that the Prophet (peace and blessings of Allaah be upon him) said: “To Allaah belongs that which He has taken and that which He gives, and with Him everything has an appointed end, so be patient and seek reward.” (Narrated by al-Bukhaari, al-Janaa’iz, 1204)
Two things must be avoided:
Gathering to offer condolences, even though the people do that.
The family of the deceased preparing food to offer to those who come to offer condolences.
The Sunnah is for the relatives and neighbours of the deceased to make food enough for the bereaved family. And Allaah knows best.
For more information see Ahkaam al-Janaa’iz by al-Albaani (may Allaah have mercy on him), and al-Mulakhkhas al-Fiqhi by al-Fawzaan (213-216).
And Allah knows the best.