The end of a person's life can lead to extremely isolating feelings. People might start to withdraw from grief or visit less due to not knowing what to say or do when death is near.
Despite feeling sad and uncomfortable, the best thing anyone can do is be there for the dying person and simply hold their hand, providing comfort in a variety of ways: emotional, mental, and spiritual.
You can help them:
Find closure / make amends with people in their lives
Find deeper meaning in their life and death
Spend time in their religious practice or meet with a religious person (priest, rabbi, minister, etc.)
Facilitate a meeting with a counselor or therapist
Share memories with them, even if they can't respond back
Let them know that you're here for them
Read more about ways to help in this article.