I think the matter of talking, figuring out and consoling will go a long way. Sharing the experience can enhance and even help them recover and see beyond their issue.
The last thing anyone shouldn’t do is make them feel useless, encourage them in the right direction.
I had moments like that myself but I’ve been more capable of reading my own problems but its the matter of going about it, another issue I had is I always felt insignificant to everything around me, which is why I always stuck to games, to get away from reality, everything so seemingly unnecessary and depressing. I always thought about committing the worst but I reminded myself that I’d end up becoming more of a burden to those around me, there’s still people who care, looked up to me even when I’m in this sorry state of mentality. So I found my recourse in helping others even if it hides my darker demons.
Ultimately, I’m happy to know what I do is helping others in any way possible so as long they don’t end up doing the worst thing possible, there is always be someone or something that’ll keep you around. Even though I am no professional in any sort of mental instability but I do know how some feel so as long I can relate to them.