I am sorry for your loss.
Your friend had to be in a lot of pain in order to take his own life.
That's what I try to remember. The person was in severe psychological pain, was suffering and was desperate for relief. This deserves compassion.
Like other illnesses, depression can take lives.
Some religious figures condemn people who commit suicide. I have talked to a couple of ministers who have thought this way. I express to them that MI is an illness, like any other illness. I tell them the person was ill, in severe pain, suffering and desperate. One minister changed her viewpoint entirely.
Nobody deserves that kind of judgement and condemnation.
I have had 3 suicides close to me, starting with my dad when I was 12 y.o.
Each one felt a little different, depending how close I have been to the person.
My advice is to show compassion for your friend and have a lot of self-compassion during this difficult time.

WC