I can't encourage suicide here since its against the rules (and I certainly do not aim to), but I personally believe in everyone's right to end their own life if it is a rational decision made after a lot of thinking without the bias of instability. I'd say the majority of suicide attempts (especially since they're almost always unreliable) don't fit this criteria since someone who really thought it out and was stable would either do it or not do it.
About six months ago, I was on the edge (maybe a month left or less, and I'm one of the types of people above so once I was ready, it was over)....I found that by accepting my position and removing the whole 'stigma' of death from my mind it helped me a lot. For my whole life I've been enduring issue after issue, heartbreak, depression, then existential depression which was a whole lot fucking worse. But I fought the idea of death/suicide so hard because I only got this far in life without going completely insane from being a fighter, which kind of predisposed me to hating the idea of giving up. Long story short, fighting against something so hard with very little energy or hope completely drained me and paradoxically drove me closer to suicide.
I found that thinking about death and accepting that it might be a valid response to genuinely being stuck in a hopeless existence that was objectively very unlikely to improve actually increased my emotional health. It was a burden off my back. However, I do understand that thoughts on this can easily be warped by strong emotions. I'm personally way past that point in my life and feel very old. I no longer felt as 'trapped' and like I had absolutely no way out. It still doesn't appeal to me but at least now I have an honest picture of what to do with my life.
Accepting my true position stabilized me and enabled me to give life a little more time and be more 'objective' about where I was headed, and to search a little bit longer for some other way out. If I had not accepted where I was despite the horrible realities of it, I would've been much more impulsive due to that trapped feeling. It may be like capitulating to the devil, but I don't think its as much the 'devil' as our society makes it out to be. Now I think we're very different people, and this is a tough thing to do because its a difficult subject to distance yourself from emotionally, but I found it helpful personally.
In your position, self exploration to a further extent about what you truly want in life and shift in perspective about how you view the world would probably be the better step to take first. Also, I hope you don't take this the wrong way and think I'm encouraging hopelessness. Just don't think too obsessively about these things as that can be bad too. I guess the general idea is that a perspective shift and understanding things more as they truly are can provide some level of personal empowerment/direction, even if its frowned upon by society. It did for me, but I went overboard with it and crashed.