If a relative or a close friend of one of your friends happen to die, hasten to offer your condolences. You should share in his grief for that is the right of your family member, friend or fellow Muslim. If you can, you should attend the funeral and the burial at the cemettery. This is a highly rewarding gesture, an effective and stern admonition, and a lesson reminding you of the inevitable end of the entire creation.
A poet addressed a deceased person and said:
“While you were alive, you gave me many a lesson, reminder and admonition,
Today your death provides me with the most important lesson.”
Rasulullah [Sallallahu álayhi wa sallam] said, “A Muslim owes his fellow Muslim five rights; replying a greeting, visiting the ill, attending the funeral…” [Sahih Bukhari and Sahih Muslim]
Imam Ahmad [Rahimahullah] reported that Rasulullah [Sallallahu álayhi wa sallam] said, “Visit the sick and follow the funeral procession, it will remind you of the hereafter.”