There is a Wikipedia article on this subject:
https://en.wikipedia.org/wiki/Suicide_by_pilot
Thirty years ago or so, I was told of a local female pilot who was an instructor for small planes. One of her students was a man she took on his first flight.
Turns out that he was hell bent on killing himself in a plane, and was stronger than she was, so was able to fulfill his wish by crashing the plane.
————
I think the basic problem here is can a pilot get counseling or therapy to deal with whatever issues are driving them to despair and desperate action without losing their career.
If getting therapy for mental health issues means that you will get fired, then obviously you will try to hide your problems, which often means they get worse.
After all, pilots have to keep training to maintain their flight skills, so why isn’t mental and medical health part of the normal practice?