It sounds like you might want to see a psychologist, a professional, who can help you with this if it's gotten to this point. We can tell you to distract yourself, read a book, exercise, meditate, etc. but we can't stop you from thinking this way. That will take some work, and therapy is a good place to do it before this become a more intense problem.