In researching my Obsessive-Compulsive Disorder, I learned that the brain is a computer, full of electrical impulses and chemical reactions; in other words, it is no different than the other physical processes of your body, such as digestion. Each has a job to do and each can become damaged or not perform in the way it should. Thoughts are like the wind, they come and go, one does not have full control over them. There can be a deep fear that you will lose control of your actions because of your thoughts or impulses. People have thoughts rushing like the wind, but they can choose to dismiss these thoughts if they are bad, or demand a bad action. There is no reason to fear losing control. Let them pass like the wind. It is not your fault that you have such thoughts, even those that your brain locks onto so you can almost think about nothing else. Do not resist or try in a desperate way not to have such thoughts. Think of a leaf from a tree that falls into a stream and gently floats away. If you do not resist your thoughts, they will slowly pass like the leaf or the wind does. You can tell yourself "that's just my OCD" and let it go.
Slowly, over a period of a year or two, my anger gradually went away. I slowly realized I was not guilty for having a brain that was not working perfectly.