It is recommended (mandub) for everyone to frequently remember death. The Prophet SAWS said (translated): “Remember often the end of pleasures” (Tirmidhi, Ibn Hibban and Hakim)
It is recommended to visit the ill, whether the person is a friend or enemy.
It is offensive (makruh) to sit lengthily with a sick person unless there is no objection.
Make supplication. If the visitor has hopes that the patient will survive, supplicate for him or her, such as: “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 leave. But if the visitor sees little hope of a recovery, encourage the patient to repent and to make his/her bequests: “You should repent for all your sins so that Allah Most High heals you, for repentance is the source of cures. And you should make some provision for bequests as it prolongs one’s life. A person should make bequest while alive and only die after having done so, for there is no one who does not pass on.”