I had never in my life seriously considered suicide before, when I was young I thought it would be a nice way to get back at my family and guilt them, but I didn't actually want to die. Then, a couple weeks after I quite smoking pot, all these painful emotions came up, and it just hurt SO BAD that I could hardly even stop thinking about offing myself wherever I went, I just wanted the pain to end, thats it.
Things were really hard those coupe weeks, but that was actually just a step in the right direction to things getting better. If I had just kept smoking pot, I wouldn't of become suicidal, but at the same time, I am also doing much better today than I was when I was still high 24/7.
I'm not sure if the same thing applies to you somehow, but think about it. Maybe youre just going through something difficult and there is a better place on the other side, not just better than now, but better than before you started having these thoughts.
Its good youre feeling better now, but maybe that pain was a message of some sort that youre ready to deal with something.