I don’t know if it is helpful with suicidal thoughts, but Learned Optimism has helped me with a more generalized despondency and helplessness:
https://github.com/raganwald/homoiconic/blob/master/2009-05-...
My won feelings about helplessness learning to play Go parallel feelings if helplessness in my life trying other things where it felt like I had no idea what I was doing and no control over the outcome:
https://github.com/raganwald/homoiconic/blob/master/2009-10-...
Again, I don’t know if any of this is helpful when someone is at the point of contemplating ending their own life.