My condolences for your loss, and my sympathies that the internet can't not be a dick about things for five minutes.
Above all, don't blame yourself. It's normal to be feeling a sort of numb detachment at first, it's nothing to feel guilty about. There's also no way you could have reasonably known or prevented this. Whatever went through your friend's thoughts before he passed away, you can be sure he didn't want to drag you down with him. Mourn his passing, but don't forget to keep living, and don't feel guilty for doing so.