Firstly,I'd like to begin by saying "Ameen" to Um Hurairah's du'ahs.Secondly,I think I could help you out since I myself have been in a similiar situation not so long ago(a few months ago).In this type of situation,there's no advice you can really give,but being there for your friend is one of the most important things you can do,and although he/she might not say it at the moment,im sure they appreciate your support greatly.
Allah(SWT) has written a time for each of us,inna lilahi wa ilahi raji3oon is the perfect reminder that we belong to he(SWT) and to he(SWT) we shall return...there's no stopping or preventing what Allah(SWT) has already chosen for us.Yes it's difficult,but your friend must learn to accept that this was their time to go(yes,easier said then done),and to know that that person does not belong to us,but to Allah(SWT)...so we really have no claim over it.
Tell your friend to recite surat Al-Mulk,Yaseen and Al-Fatiha,which are all good for the deceased.Also,if your friend is able to,let them research and learn about death in Islam,because understand it can help you accept it.
I was always told that we should always remember death,so to not get too attached with this world.
Also,try to help your friend open-up,tell you how they feel,if not you then a family member...anyone,as long as they let it out.
I've read numerous time on this board and elsewhere that Allah(SWT) doesn't send us difficulties which he(SWT) knows we cannot handle.
Lastly,this life is short,only Allah(SWT) knows what will happen toomarrow,so always follow Islam as best as you can.
Inna lil'ahi wa ilahi raji3oon.
P.S Du'ahs help too.
