@SW-User
There's lots you can do.
You can help to comfort that person and his/her loved ones.
People meet death with more calm if they have the chance to resolve leftover issues. (I'll use "they" because I don't know the gender.)
Always check whether they are in pain; try to get better medications for them if necessary.
Check whether marijuana would help with pain and/or appetite.
Ensure they get their favourite foods and drinks, and are kept clean, warm and comfortable.
The smallest things can help make-up, hair, shaving, music, incense or oil burner, flowers - all their favourites.
Time with their pets if possible.
Visits from friends and family.
If they are feeling anxious, fearful or depressed, listen deeply and actively. Accurately reflect their reality back to them so they know you have really heard.
Tell them how much you love them and will miss them when they're gone.
You can ask:
What they are proud of having achieved?
What were the moments in life that they enjoyed the most?
Is there any action they regret and would like to make amends for? If so, what can be done (on their behalf)?
Is there anyone they want to say sorry to? (Organise the meetings, zooms, facetimes or phone calls for them - or assist them to do these if they can.)
Are there any undone things that need to be resolved?
Do they need to write an Advanced Health Directive and?or a Will? If so, help them find the help they will need - lawyer, doctor etc.
Let them know that you will help them in any way you can to ensure that their wishes and needs are met.
If all of these have/are already attended to, then just sit with them as often as you can - share your news, discuss mutual interests, reminisce about times shared. Let them know what kinds of difference they have made to your life. Be sure they know you love them.
For yourself, allow yourself to feel the grief in all its phases. It will come in all forms like weather. It's okay, even when it's overwhelming. The more you allow yourself to feel it, the deeper your wisdom and understanding of human nature will grow.