^Super important point right there.
In the comic I'm working on the main character kills himself in the first handful of pages. It was really important for me to not come off as just being edgy for edgy's sake.
I think the best way to avoid being edgy is to treat your characters like actual people, approach their situation and behavior with sympathy. Understand WHAT they're doing and WHY they're doing it on a deeper level, not just tragic backstory stuff, this includes the bad guys who do horrible things Don't just say it's because they're crazy or because they had one horrible tragic moment in their past that screwed them up beyond belief. People don't have switches like that. "This character was abused as a child and now he's a horrible murderer because of it" is passively saying that people who have dealt with childhood abuse are fated to become horrible people, and that's not the case. That doesn't mean that you can't use that character, but you and your audience and your narrative need to be aware that the characters past and the characters present are not a cause and effect. @Kamikaze's advice about using TVtropes as a guide is probably the best way to check yourself on this, next to actually talking to people who have dealt with or have done the sorts of things you're writing about.
Understand that people who do horrible things aren't remorseless usually. Maybe they won't feel guilty right away, but eventually they will, and that will eat away at them. They can't go back and change what they did, they have to live with the consequences. That's a tragic thing.
Understand that not every piece of behavior has a clear cause. Why does my character commit suicide? It doesn't matter, depression doesn't always have a rational cause and it doesn't always lead to predictable behavior. Pretending like it does is a disservice to people who actually have to live with depression, or with a friend or family member who committed suicide. If I said it's because he wasn't treated well by his parents in his early childhood, I'm not only demonizing his fictional parents, I'm demonizing every parent with a kid that killed themselves, regardless of how well they treated their kids.
Also, side note, a lot of people are saying that you have to portray bad things in a negative light, or that you have to pass Judgement on the characters who do bad things. I don't think that's the case at all. Steven Universe is a good example of how to do this. The characters have done bad things, and they are capable of doing bad things. The audience doesn't need to be told that those things are bad, and we can reasonably assume that the creators of Steven Universe dont condone those bad things, even if a character doesnt get their due justice or if the naratavie doesn't call them out.
ALL OF THAT SAID the last REALLY IMPORTANT advice that I have for you is to not forget that good things can also happen. If your entire story is just one awful thing happening after another, the audience will become desensitized, and you don't want that, not only because it will make your readers bored, but it will make it so they treat the issues you're covering with less respect and they wont care as much if they ever encounter it in real life. Having some happy moments in your story will make the bad moments hit harder too, because the audience has something to compare it too within the narative.
I guess TLDR, don't treat the subject matter you're handling as black and white. It's complicated stuff with a lot of nuances, be careful about what you might actually be saying when dealing with those topics, And don't forget that good things can happen too.