It is natural to have thoughts like this occasionally, but if they occur regularly and tend to affect your regular function and affect your well being, I would suggest you visit a psychiatrist. These could be a part of an anxiety disorder, and would improve with the right treatment that would comprise counseling and medications, if indicated.