The symptoms you describe are most likely of an Obsessive Compulsive disorder
falls under the anxiety
spectrum disorder in the classificatory system, and hence has associated depressive and anxiety features.
The disease is characterized by repetitive, intrusive thoughts
on a myriad of themes like fear of dirt and contamination, fear of harm to near and dear ones, repetitive doubts, intrusive images and uncontrollable impulses. Compulsions are basically motor acts like repetitive washing, checking, slowness with activities etc. which the sufferer usually perform to reduce the anxiety associated with the obsessive thoughts.
OCD is treatable. There are psychotherapies like ERP, CBT etc. which have been successfully used in such cases. Along with them, there are medicines to address the issues.
I would suggest a consultation with a Psychiatrist
for proper and comprehensive management. I believe the prognosis can be good.
Hope that helps.
Dr. A. Rao