This is one of the stickier issues for me in terms of using magic to work on it. You see, the root of many of my mental health issues is magical thinking.
Magical thinking, in a mental health context, is the irrational belief that one action or series of actions can affect something entirely unrelated. As an example, when I was small, I took the "step on a crack, break your mother's back" nursery rhyme very seriously. I worried that I was a terrible child and that, if I stepped on a crack and something bad happened to my mom, it would be my own fault. Therefore, carefully avoiding cracks kept my mother safe.
To most people, that is a childish thought process that should be outgrown. For someone with OCD, however, this kind of thinking can become a way of life. In my late teens and early twenties, I often found myself paralyzed with anxiety that I might accidentally do something to hurt people, or worse, that if I didn't watch myself, I would intentionally destroy everything I cared about. This was the period where I first started intently studying magic via text files on the internet and, later, books and message boards.
I quickly folded spellwork into my anti-anxiety regime. Doing a spell to ward against something was like not stepping on cracks or counting the number of times I did things, it was just something I did to make it easier to avoid obsessing.
That worked until one particular spell worked so well that I was no longer able to convince myself magic was just a useful technique. When it sank in to my brain that magic really worked, I panicked. Suddenly here was this new, huge source of potential terrible things.
One common symptom of OCD is intrusive thoughts that you can't help going over and over repeatedly. This is the O in OCD, the obsession. These are thoughts that you don't want to have and can't get rid of. They're sometimes violent and often morbid. You want to get rid of them any way you can - that's where the C, the compulsion, comes in. But think about the idea of having a terrible thought that you can't stop thinking about. It goes around and around. It won't go away. You hate it. You know you're a horrible person just for having this thought.
Now add in the magical context. Not only do you keep thinking this thing, but you know that your will could make it happen. You fear accidentally hurting people, or intentionally hurting them; now you know you can do that just by thinking really hard about it and you can't stop thinking really hard about it. (Yes, I'm oversimplifying, but I think you get the idea.)
Not only did I have a whole new source of anxiety about my obsessions, I'd just lost one of my most effective series of compulsions to deal with them. For a couple of years afterward, I became obsessed with psychic hygiene. It was the magical equivalent of washing my hands six times in a row because six is a safe number. I was casting circles, reinforcing shields, flinging incense everywhere, and reading anything and everything in search of more techniques. At the same time, my ex was constantly undermining my confidence in my psychic hygiene, reinforcing my hangups and anxiety.
When I first started trying to control the magical thinking, I ended up letting the last of my magical practice go. I decided to "disbelieve the illusion" that magic was real, giving myself the time and space I needed to recover. If it wasn't real, that was one less thing to obsess over.
Now I think I'm ready to restart my magical practice, but to do that I have to keep my own tendency toward magical thinking in check, as well as addressing my depressive tendencies and other neuroatypicalities. This isn't really a goal I can reach in and of itself. Instead it's a constant project, something I have to keep in mind in pursuit of other goals.