Suicidal thoughts can sometimes be a coping mechanism. Here's a link to an article, from PC's archives, that addresses this:
How Suicidal Thoughts Can Become a Coping Mechanism
So perhaps the thoughts you're experiencing are a sign there are things going on in your life with which you're still struggling? Perhaps it could be a symptom of anxiety. Or perhaps it's simply a habit you've fallen into over time that you can't shake? I don't know the answer to that, of course. It's something you're going to have to figure out either on your own or perhaps with the help of a counselor or mental health therapist. At least these are my thoughts with regard to your post.
Here's a link to a second article that offers suggestions for how to get rid of stuck thoughts:
9 Ways to Let Go of Stuck Thoughts