&The guidance of the Prophet (peace be upun him) in funerals was complete, unlike that of other nations. It included good treatment of the deceased, his family and relatives. Such care begins as early as visiting the dying person during his illness, reminding him of the Hereafter, advising him to write his will and repent, and asking those beside him at his death bed to encourage him to recite the testimony, "La ilaaha ill-Allah" (There is no god but Allah), so it will be the last words uttered by him.
Of all mankind, the Prophet (peace be upun him) was the most pleased with Allah concerning His decree, expressing utmost praise for Him. He wept on the death of his son, Ibrahim, out of mercy and compassion for him. But his heart was full of acceptance and gratitude to Allah and his tongue was occupied with mention of Him and praise. He (peace be upun him) said,
“The eyes shed tears and the heart is full of sorrow, but we say only that which the Lord accepts.”
He (peace be upun him) forbade the slapping of cheeks and loud wailing over a death.
It was his guidance to hasten the preparation of the dead person to meet his Creator, cleaning him and shrouding him in white garments.
It was his guidance to cover the face and body of the deceased and to close his eyes.
At times he (peace be upun him) kissed the dead person.
He (peace be upun him) ordered that the dead person be washed three or five times or more, using camphor in the final rinse.
He (peace be upun him) did not wash a martyr killed in a battle. He used to remove the leather and metal from the martyrs and bury them in their clothes without offering the funeral prayer for them.
He (peace be upun him) ordered that a person in ihraam be washed with water and sidr (ground lotus leaves), shrouding him in his ihraam garments. He (peace be upun him) prohibited perfuming him or covering his head.
He (peace be upun him) ordered the guardian of the deceased to provide a decent white shroud for him, warning against extravagance in choosing the shroud.
If the shroud was not sufficient to cover the entire body, he (peace be upun him) would cover the head and place some grass on the legs.
a. His Guidance in the Funeral Prayer
He (peace be upun him) used to pray for the dead person outside the mosque, although he might pray for him in the mosque as well, but that was not his usual practice.
When a body was brought to him he (peace be upun him) would ask,
"Has he any debt?"
He (peace be upun him) did not perform funeral prayers for those who had died in debt but told his companions to offer the prayer for them. However, when Allah granted him wealth he offered funeral prayer for people who died in debt and settled their debts, leaving their property for the heirs.
He (peace be upun him) began the funeral prayer by saying, "Allahu akbar", praising Allah, glorifying Him and supplicating. He (peace be upun him) would say, "Allahu akbar" four or five times.
He (peace be upun him) urged people to pray sincerely for the deceased. Some of his supplications were: "Allaahumm-aghfir lihayyina wa mayyitina wa sagheerina wa kabeerina wa dhakarina wa unthaana. Allaahumma man ahyaytahu minna fa-ahyihi 'alal-Islam, wa man tawafaytahu minna fatawafahu 'alal-iman. Allaahumma la tahrimna ajrahu wa la taftinna ba`dah." (O Allah, forgive our living, our dead, our young, our old, our males, our females. O Allah, whoever among us You keep alive, let him live in Islam, and whoever You cause to die, let him die in the faith. O Allah, do not deprive us of reward for [losing] him, do not subject us to trial after him.) Another of his supplications is as follows: “Allaahumm-aghfir lahu warhamhu wa`fihi wa`fu `anhu wa akrim nuzulahu wa wassi` madkhalahu waghsilhu bil maa'i wath-thalji wal-barad. Wa naqihi minal-khataaya kama yunaqath-thawbul-abyadhu mina-ddanas. Wa abdilhu daaran khayran min daarihi wa ahlan khayran min ahlihi wa zaujan khayran min zaujihi wa qihi fitnatal-qabri wa adhab an-naar." (O Allah, forgive him, have mercy on him, cure him, pardon him, be generous to him, cause his entrance to be wide and comfortable, wash him with water, snow and hail. And purify him from sins as a white garment is washed clean of dirt. Compensate him with a home better than his [earthly] home, a family better than his family and a wife better than his wife, and protect him from the trial of the grave and the torment of Hellfire.)
He (peace be upun him) used to stand for the prayer opposite the head of a deceased man and opposite the waist of a deceased woman.
He (peace be upun him) performed the funeral prayer for a child, but he did not offer it for a person who committed suicide or one who cheated in taking spoils of war.
He (peace be upun him) performed prayer for the woman from Juhaynah whom he ordered to be stoned.
He (peace be upun him) offered prayer for Najashi [in absence] as he did for a dead person, but did not offer prayer for everyone who died far away.
If he (peace be upun him) missed a funeral prayer, he would pray at the grave.
b. His Guidance in Burial and Related Matters
After offering the prayer for the deceased the Prophet (peace be upun him) would accompany it to the cemetery walking in front of the body. If a person was riding, he (peace be upun him) would follow behind the body, but if he (peace be upun him) was walking he would be close to it, either in front, behind, to the right or to the left of it. He (peace be upun him) used to order them to hasten with the funeral procession.
He (peace be upun him) would not sit before the body was put down.
He (peace be upun him) ordered his companions to stand up for a funeral procession that was passing by. But it is correctly reported that he also sat.
It was of his guidance not to bury the deceased at the time of sunrise, sunset or at high noon.
His guidance was to make a niche for the body in the side of the grave and to deepen the grave, widening the place for the head and feet.
He (peace be upun him) would throw three handfuls of soil near the head of the dead person when he was buried.
After the burial, he (peace be upun him) stood at the grave praying for the deceased and ordered his companions to do so.
He (peace be upun him) never sat to recite the Qur'an at a grave, nor did he dictate "La ilaaha ill-Allah" to the dead person.
It was his guidance not to loudly announce the death of a eminent person [as was the pre-Islamic custom] and he (peace be upun him) prohibited this practice.
c. His Guidance Concerning Graves and Condolences
It was not part of his guidance to elevate or construct anything over graves, nor to plaster them with mud or build domes on them.
 When he (peace be upun him) sent Ali to Yemen he (peace be upun him) told him to obliterate all idols and level all elevated graves. His own practice was to level all elevated graves.
He (peace be upun him) prohibited the whitewashing of graves, building anything on them and writing on them.
He (peace be upun him) taught those who wanted to recognize a grave to place a stone on it.
He (peace be upun him) prohibited taking graves as places for prayer and lighting lamps on them, and cursed whoever did so.
He (peace be upun him) prohibited praying toward graves, and warned against making his grave a place of worship.
His guidance was that graves should not be mistreated, stepped on, sat on, leaned on or glorified.
He (peace be upun him) used to visit the graves of his companions to supplicate for them and ask Allah to forgive them. His sunnah for visiting graves was to say:
“As-salamu alaykum ahl ad-diyyari min al-mu’mineena wal-muslimeena, wa inna in shaa Allahu bikum lalaahiqoon. Nas'al Allaaha lana wa lakumul-‘aafiyah."
(Peace be upon you, O dwellers of this home of believing men and believing women. Indeed, we will join you, Allah willing. We ask Allah to grant us and you freedom from all evil.)
It was of his guidance to offer condolences to the family of the dead person but not to gather especially for the purpose of offering condolences or to recite Qur'an for him, whether at the grave or elsewhere.
It was his guidance that the family of the deceased should not be put to difficulty by having to serve food to people. Quite the opposite - people should prepare food for them.