You focus on gratitude that you had this friendship at all.
You remind yourself that life IS change,
And that the only thing we can absolutely count on retaining while we live . .is our own life.
And when you feel very sad about him being gone, you close your eyes, focus on your breath, and RELAX (both physically and emotionally).... the more you allow your sorrow to be there without getting upset about it, the less upset you get. And the more you train your mind to stop getting upset.
However, the more we resist our sorrow, the stronger it becomes.
It's not easy, but you will lose a lot more people before it is your time to go ... so you might as well start learning how to cope with it now.