"Compulsion--an irresistible persistent impulse to perform an act (as excessive hand washing)."
"Obsession--a persistent disturbing preoccupation with an often unreasonable idea or feeling," OR "an activity that someone is very interested in or spends a lot of time doing."
When I was a child, I had a few mild "compulsions." One of them concerned the closet door in my room. I insisted that it either had to be closed and latched, or that it be opened completely, as wide as it would go, so that the doorknob was touching the wall. If I noticed that the door was almost, but not quite closed, I would get up from my bed and close it.
As an adult, I have a "routine," I have "quirks," I have "habits," but I don't think I have "compulsions."
I have "obsessions" in the second sense. I spend a lot of time on an internet forum (not this one). Since I probably spend too much time on it, in a half-joking way I might call it "an obsessions of mine" or even "an addiction."
I sometimes worry about silly things, but I don't have any PERSISTENT, troubling thoughts that I can't get rid of.
If I had some pattern of behavior that was so powerful that it was interfering with my life and making it difficult for me to do things I really wanted to do, then I would consider looking for professional help.