Taking care of the dying What advice did the Buddha give to laypeople or monastics about taking care of a dying loved one or anyone dying in their deathbed?
Please read &quot;Ministering to the Sick and the Terminally Ill&quot; by Lily de Silva.
All teachings from the suttas related to this topic are summarized in this essay.
Here's a quote from it.

The Sotapattisamyutta contains a valuable discourse on the question of
counseling the terminally ill (S.v,408). Once Mahanama the Sakyan
inquired from the Buddha how a wise layman should advise another wise
layman who is terminally ill. Here it should be noted that both the
counselor and the patient are wise lay Buddhists. The Buddha delivered
a whole discourse on how this should be done.
First, a wise layman should comfort a wise layman who is terminally
ill with the four assurances: &quot;Be comforted friend, you have
unshakable confidence in the Buddha, Dhamma and Sangha, that the
Buddha is fully enlightened, the Dhamma is well proclaimed, and the
Sangha is well disciplined. You also have cultivated unblemished
virtuous conduct which is conducive to concentration.&quot;
Having thus comforted the patient with the four assurances, he should
ask him whether he has any longing for his parents. If he says yes, it
should be pointed out that death will certainly come whether he has
longing for his parents or not. Therefore it is better to give up the
longing.
Then, if he says he gives up his longing for his parents, he should be
asked whether he has longing for his wife and children. With the same
reasoning he should be persuaded to give up that longing too.
Then he should be asked if he has any longing for the pleasures of the
senses. If he says yes, he should be convinced that divine pleasures
are superior to human pleasures, and should be encouraged to aspire
for divine pleasures.
Then he should be gradually led up the scale of divine pleasures and
when he comes to the highest heaven of the sense sphere, his attention
should be diverted to the Brahma-world. If he says he has resolved on
the attainment of the Brahma-world, he should be admonished that even
the Brahma-world is characterized by impermanence and the rebirth
personality.
Therefore it is better to aspire for the cessation of the rebirth
personality. If he can establish his mind on the cessation of the
rebirth personality, then, the Buddha says, there is no difference
between him and the monk who is liberated.