Since how long has this been happening? What measures have you taken yet to handle the situation?
The problem is common and needs immediate Psyhciatric and Psychotherapeutic help.
You must go to a Psychiatrist and seek psychhotherapy from a trained psychologist immediately. Please do not delay.Having said this, please understand that these issues are manageable and treatable with right and continued help. You can contact my office if you are unable to find a doctor near you. They will guide you to someone near you.
Plan your day doing Pleasurable, Important and Necessary things everyday. Be sure to get out in the mornijng sun for sometime, may be to a park or a walk. Exercise everyday. Id you do these things everyday along with what your doctor suggests, you may see a change soon.
Please understand that the human mind is like a monkey. It is always restless and gets into problems. Everybody gets negative thoughts; there is no exception. Ignoring these thoughts is the only way out. How to ignore them is an art which you should learn through the practice of pranayama, yoga and meditation.
But if you constantly have the same negative thought, it might suggest that you have Obsessive traits(if not an obsessive compulsive disorder). Whether it requires treatment can be decided by a psychiatrist only when he can interview you in person. Treatment will also give you relief from your sleep problem.
Please consult a psychiatrist in person and discuss your case. You may also request him to get your blood tested for the above or any other medical conditions that he may suspect.
Do not be disturbed with what I have written. You will recover completely and do well with professional help.