Sometimes, the world is a hopeless place and the future holds little for you. But that is for you to decide, not someone commenting on the internet. Sometimes, your life is great, and you want to end on that highnote and not watch it slowly erode. I won't judge a stranger as good or bad based on their life choices, because I am not their judge. I had a grandfather that chose to drive to a park, watch a beautiful sunset, and finish it off with a shotgun. He was not a bad man, he didn't need to be "cured", in fact, he probably had 10 years of life ahead of him, but he chose not to live it. And that is a beautiful choice, just one of the infinite number of choices any of us can make.
This is why things that affect your very thinking are so insidious. Think of sleep deprivation or hypoxia. Ever watched a video of someone trying to draw simple shapes while not getting enough oxygen? The crucial point is that they think they are okay.
When I was feeling suicidal it seemed like the only logical solution to a set of unsatisfiable constraints. However, none of these were particularly hard constraints. As a relatively privileged person I was ashamed to reach out for help, because I felt I was letting everybody down. Don't be ashamed. It can do weird things like convincing you that it's better to kill yourself than inconvenience your self and others by e.g. quitting a job, or failing some courses.
To make a coding analogy -- sometimes your client / management etc. tells you they want X and Y and Z. The set of solutions to X and Y and Z is empty. However, if the constraints were relaxed, X and Y is solvable. Y and Z is also solvable. Maybe they didn't really want X anyway. This closing down of options seems to be a common pattern, however it's often false.
Very few people are actively being tortured to the point where death is the only logical escape. Typically, there's more of a spiral inward where more and more options disappear until only one seems to be left. Typically there are so many steps along this path that removing a few constraints or realizing that they're not really there can make all the difference.
Yes, everyone who died is insane.
Seeing as not so many people came back from death, life is not so much of "best next thing after sliced bread". It is just an experience, don't hang on it too much. ;)