Hi OP.
I have struggled with anxiety and depression for years. It was at it’s worst when in college.
I recently found God in my life. At the same time as I found God, I also fell into a fairly deep episode of depression/anxiety. Which brought about scrupulosity.
I know EXACTLY how you feel, based on what you described. I have been getting better and better slowly.
I found that the one of the best ways (other than prayer) was to be conscience of my scrupulosity as soon as it starts. For example:
I’m walking in to work and see a pretty girl and begin to have a an impure thought. As soon as I recognize what I’m doing, I stop my self, look away and ask God for help. Unfortunately, sometimes I will get stuck in this endless spiral of , “Did I resist temptation? Did I let my self have that thought for too long? Do I need to confess this? Is this a mortal sin because I thought about it? Can I receive communion” As SOON as I notice that I’m having those spiraling thoughts, I try to be conscience of what is happening. I become cognizant of these scrupulous thoughts, and do my best to realize that I need to be as rational as I can and move on.
I just think that naming the thoughts and pointing them out is the first step.
I will be praying for you. God bless.