So, a quite few years ago I had a friend named Malcolm Xerxes commit suicide, which means that I have a perspective on this that quite a number of others possibly don't.
It is possible to handle this sort of content well (it is something I deal with in my Re:Apotheosis sequel The Odyssey of Daiki Yamato and one of the other stories collected in Re:Apotheosis - Aftermath), but it's not a plot device, or a character quirk, and should not be treated as such. It needs to be handled with sensitivity and nuance.
So, if you are going to do this, do your research. Make certain that you are presenting it, and the mental illness or circumstances that lead to it, to the reader with accuracy and empathy. And if you're not going to do that, you would be better off finding something else to flesh out your protagonist.