As I was driving home one day, it occurred to me that suicide might be adaptive. I was surprised to find that this has been investigated and the answer is "yes, suicide can be adaptive". Notice that I say, "can be" rather than "is". Being an evolutionary dead end is extreme. It is a bad idea all-round.
Two related things appear to motivate suicide in terms of inclusive fitness:
1) Ideation that reproductive success is negligibly probable.
2) Ideation that one's continued existence is a burden on kin and negatively impacts their reproductive fitness.
The first can come from isolation, few friends, and no partner. Likely depression is both cause and effect.
The second is about resources and the impact of the individual on those resources. As above, a link to depression is likely. People feel ‘useless’ to kin, that they are just taking up space, and they are, or will come to be, a burden to kin.
In genetically related groups, self-removal may increase overall reproductive success. Natural selection favors genes without remorse.
This is not an argument in favor of suicide. It is, rather, a model to understand what motivates suicidal ideation in individuals. We can use that to identify those at risk and plan effective intervention. Suicidal ideation and attempted suicidal behavior are a serious indicator of risk. It is not just a stunt to gain attention. It may well be to gain attention, but that is because attention, investigation and intervention are necessary to save the individual. We should see this as a cry for help, and then help.
Suicide prevention services can be ineffective and sometimes, it would seem, negligent. They advertise to call a help line but when people do, they are left on hold or calls are abandoned. “One out of six calls made to the National Suicide Prevention Lifeline between 2016 and 2021 didn't reach a counselor” -- 1.5 Million Calls to Suicide Hotline Were Abandoned
Hopefully, this new number will do better than those before. However, the fact that people are isolated, uncared for and hopeless to the point of ending their own lives is a problem that requires more than a new phone number and congratulations all around. Pretending to help is cruel. It can become a way to blame the victim. It is worse than no help at all.
Here are some references if you wish to know a little more.