Here are some religious guidance when a Muslim is close to death:
When a person is close to death then those around him should try to get him to face in the direction of Mecca (Qibla) if possible, though this is not a necessity.
It is also recommended to remind the dying to recite the testimony of faith (Shahadah). Those around him/her may recite Surah Yasin and Surah Ra’d from the Holy Qur’an.
Once the soul has departed, the eyes should be respectfully closed and a a clothe placed from the head to the bottom of the chin going all the way round so the mouth is not left open and the hands and feet should be also straightened at this point.
Upon closing the eyes of the deceased, the following words should be recited, ‘Bismillahi wa ala millati Rasulillah.’ (In Allah’s Name and upon the religion of the Holy Prophet).
According to the Sunnah, any money owed by the deceased should be cleared before his burial.
Family and friends should be informed of the death so people can pray for his final journey and forgiveness.
There is nothing wrong with reciting the Holy Qur’an and other recitations besides the body of the deceased with the condition that that whole body is covered with clothes or the shroud in accordance to the Hanafi tradition.
Due to the stress of the death of a family member, the family will usually not cook even though it is not prohibited to do so. It is from the Sunnah that only the first day food is sent for the immediate family and they should be convinced to eat it.