Two things people are told that make it worse

Increase your ibadah and it will go. For most people this is good advice. For a person in this pattern it frequently increases the problem, for the simple reason that the compulsions are made of ibadah. More acts means more surface for the checking to run on.

And renewing your shahadah, or your marriage contract, every time an intrusive thought arrives. This one needs care to say. Nobody here is telling you that a religious act of yours is a symptom, and that judgement is not ours to make. What can be said is that the scholars did not require this, and that any act repeated in order to remove a feeling, which then has to be repeated again an hour later, is a recognised pattern with a known treatment. Raise it with somebody qualified rather than settling it from a page.

This is also where two subjects collide badly. If somebody tells you the doubt is a jinn or the effect of sihr, and the real answer is an obsessive compulsive presentation, people can lose years to that.