I wrote this elsewhere but I'm trying to deal with this shit now and framing in a sort of FML, tongue-in-cheek, slightly morbidly funny way helps.
One of my compulsions is avoidance- betcha didn't know that could be a compulsion, I sure didn't! ...also to clean and clean and organize and catalog and list and count and document and, and, and...
Playing the constant What If Game when your go to for stopping obsessions and fear is avoidance and a runner up is to clean and organize and straighten and create things to clean organize and straighten? Exercise in absurdity.
Then there's the repetition of "Don't Do That Wrong Thing You Are About To Do"- where you get caught in something like the inevitable Consequences of Time-Travel decisions loop, only its in your head and it's for real because you don't actually know if shutting the door half way is better than shutting it a third of the way ["leave it ajar"] while in your mind what you decide could actually affect the fate of your first born.
OCD: an entirely different type of "logic".