Praise be to Allaah.
Firstly, it is obligatory to carry the deceased and follow the funeral. This is one of the rights that the dead Muslim has over the Muslims, which will bring great reward and virtue to the one who does it. The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Whoever attends the funeral from the house (of the deceased) [according to one report: whoever follows the funeral of a Muslim out of faith and the hope of reward] until the funeral prayer is offered will have one qeeraat, and whoever attends the funeral until the deceased is buried will have two qeeraats.” He was asked, “O Messenger of Allaah, what are the two qeeraats?” He said, “Like two huge mountains.” (Narrated by al-Bukhaari, al-Janaa’iz, 1240).
It is not permitted to follow funerals in manners that go against the sharee’ah. That includes:
Crying or weeping in a loud voice; following it with incense (bukhoor) etc.; reciting dhikr in a loud voice in front of the coffin as it is being carried, because that is bid’ah – Qays ibn ‘Abbaad said: “The companions of the Messenger of Allaah (peace and blessings of Allaah be upon him) used to regard it as makrooh to raise the voice in front of the coffin” – and because it is an imitation of the Christians.
Secondly: the burial
Muslims should not be buried with kaafirs, nor kaafirs with Muslims. The Muslim should be buried in the Muslim graveyard.
The Sunnah is to put the deceased into the grave from the end, then he should be turned onto his right side in the grave, with his face facing towards the qiblah. The one who puts him into the lahd (niche in the grave) should say, “Bismillaahi wa ‘ala sunnat Rasool-Allaahi or ‘ala millat Rasool-Allaahi (peace and blessings of Allaah be upon him) (In the name of Allaah and according to the Sunnah of the Messenger of Allaah or according to the religion of the Messenger of Allaah (peace and blessings of Allaah be upon him)).”
(narrated by al-Tirmidhi, al-Janaa’iz 967; classed as saheeh by al-Albaani in Saheeh Sunan Abi Dawood, 836)
It is mustahabb for those who are at the grave to throw handfuls of earth, three handfuls scooped up in both hands, after the lahd has been sealed.
After the burial is complete, there are several things which are Sunnah:
To make the grave a little higher than the ground, approximately a handspan, and not to make it level with the ground, so that it may be distinguished as a grave and respected, and not subjected to disrespect. It should be made approximately a handspan higher than the ground, and there is nothing wrong with placing a marker such as a stone or something similar, so that others of his family may be buried near him later on. Water should be sprinkled on the grave so that the soil will settle and not fly around. No one should stand by the grave telling the deceased that he will be questioned soon etc., as is the custom among some people Rather people should stand at the grave and pray for the deceased to be made steadfast and for forgiveness for him. Those who are present should be told to do this, because of the hadeeth of ‘Uthmaan ibn ‘Affaan (may Allaah be pleased with him), who said: “When the deceased had been buried, the Prophet (peace and blessings of Allaah be upon him) would stand by (the grave) and say: ‘Pray for forgiveness for your brother and ask for him to be made steadfast, for even now is he being questioned.’” (narrated by Abu Dawood, al-Janaa’iz, 2804; classed as saheeh by al-Albaani in Saheeh Sunan Abi Dawood, 2758).
Nothing of the Qur’aan should be recited at the graveside, because this is bid’ah. The Prophet (peace and blessings of Allaah be upon him) did not do this, and neither did his noble Companions. It is haraam to build up graves or to plaster them or to write anything on them, because Jaabir said: “The Messenger of Allaah (peace and blessings of Allaah be upon him) forbade us to plaster graves with gypsum, to sit on them or to build anything over them.” (Narrated by Muslim, al-Janaa’iz, 1610. According to Abu Dawood, “He forbade us to plaster graves with gypsum, to write on them or to step on them.” (al-Janaa’iz, 3226. Classed as saheeh by al-Albaani in Saheeh Sunan Abi Dawood, 2763)
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).