VISITING THE SICK AND THE DYING
In Islam, it is recommended for everyone to frequently remember death, particularly if one is ill, and to prepare for it by repenting i.e. performing Taubah. This is because of the following hadith of Rasulullah SAW:
"Remember often the Ender of Pleasures (i.e. death)." (Riwayat Tirmidhi, Ibn Hibban & Hakim)
In the version narrated by Imam Nasa'i's the following addition is quoted:
"...for truly, it is not remembered in a plentitude save it diminishes it, and not remembered in a dearth save it increases it."
The word "plentitude" above refers to wives and this-worldly goods, and "dearth" refers to spiritual works which will be useful for the Afterlife.
It is recommended to visit the ill, even if the malady is only sore eyes, whether the person is a friend or enemy. If the sick person is a non-Muslim subject of the Islamic state (i.e. a dhimmi) then if he is a relative or a neighbour, visiting him is recommended. Otherwise, visiting him is merely permissible.
It is offensive to sit lengthily with a sick person. It is recommended not to continuously visit, but only from time to time, unless one is a relative or a similar person - such as of his friends; whom the sick person is fond of; or someone of the righteous, from whose presence others derive spiritual blessing barakah: for any of whom - visiting the sick person is recommended at any time as long as there is no objection from the sick person.
If the visitor has hopes that the patient will survive, he supplicates for him / her by saying:
"O Allah, Lord of Men, remove the harm and heal - for You are the Healer besides whom there is no other - with a cure that will not leave behind pain or sickness", and then leaves.
But if the visitor sees little hope of a recovery, he should encourage the sick person to repent and to make his bequests (wasiat) by telling him e.g:
"You should repent of all your sins so that Allah Most High heals you, for repentance is reason for cures. And you should make some provision for bequests, as it prolongs one's life. A person should make bequests while alive and only die after having done so for there is no one who does not pass on."
INSTRUCTING THE DYING PERSON
If the visitor sees the person is dying, he should make him desirous of Allah's Mercy since hope should predominate over fear in this state and should turn him to face the direction of the qiblat by laying him on his right side, or if that is impossible, then on his left. If this too is impossible, he is laid on his back - with his face and the bottoms of his feet towards the direction of the qiblat. The face can be directed towards the qiblat by proping up his head a little.
The visitor should then instruct the dying person to say:
"There is no God but Allah,"
- letting him hear it, with the hope and intention so that he can repeat it, but without irritating insistence, and without telling him "Say..."
When he says it, then he is let be until he himself speaks of something else. It is recommended that the person instructing him to say it be neither his heir nor enemy.
IMMEDIATE MEASURES AFTER DEATH
When he dies, it is recommended that the kindliest (best of mannerism i.e. politest) to him of his unmarriageable kin (mahram) close his eyes.
It is recommended:
1. to close his jaws with a wide bandage tied above his head so his mouth is not left open;
2. to make his joints flexible by bending the forearm to the upper arm, calf to thigh, thigh to stomach, and then straightening them, and to similarly flex the fingers in order to facilitate washing and shrouding him. It is important to point out that if the joints are flexed at this point, they remain flexible, but if not, it becomes impossible afterwards;
3. to gently remove his clothes, and to cover him with a light cloth, tucking the edge of the cloth under his head and feet so they do not become uncovered; and
4. to place something heavy on his stomach, as this shall help to prevent bloating.
It is recommended to hasten in paying off the debts of the deceased or having them waived by creditors. It is recommended to hurry in implementing his bequests, and in readying him for burial. Haste here is recommended in readying him and burying him when it is unlikely that the body will rapidly change, but obligatory when this is likely.
When someone dies suddenly, or is believed to have died, the body is left until it is certain he is dead.
Washing the dead person, shrouding him, praying over him, carrying him, and burying him are communal obligations i.e. Fardhu Kifayah. Those who are involved with such preparations obtain tremendous rewards, InshaAllah.