I hate how people label suicidal thought as a mental illness. At some point the veil of our huma reality vanishes before us, and we are left off with the absurdity and pointlessness of it all. Nothing matters, and ultimately, we live and die alone. These are only words, but when you really start feeling these sentiments, you just want to stop it all.
I personnaly have been struggling with depression and suicide for a long time, the only thing keeping alive is the desperate efforts of reparing the veil with several projects. But I know that once these are accomplished, or that I got bored of them, every night will again start to be a fight against this nightmarish emptiness before sleep.
Also if your friend is distancing himself from others, its probably cause he realized that he'll never connect with people, worlds are limited frustrating tools.
Tl;dr: this is not a mental/psychological problem, but a philosophical one.
Also quit philosophy, it will ruin your life.