Obessive thinking is characteristic of anxiety disorder. You learn to manage it by allowing the thoughts to be there. Allowing them to float in and out as they please. Your resistance to the thought is what keeps it so strong in your mind. If you didn't mind that the thought was there it would not have any affect on you at all. Watch your thoughts unemotionally. They come back less and less with practice and with less intensity because you are no longer reacting to them. Instead of wishing the thought away, bring your attention to your breath. Just notice yourself breathing normally. Then keep your attention on what you are doing in the present moment, whether it is doing dishes, reading a book, gardening, whatever. When the intrusive thought comes in gently bring yourself back to your breath and then to what you are doing in the moment. Even if you are tying your shoe. Just be in the moment. Practice this.
Hyperventillation will not kill you. At the very worst all you will do is pass out and come to within seconds breathing normally again. It is nothing to fear. Learn to change your attitude towards it. "It's no big deal, so I will leave it at that." "Let the thoughts come." "So what." "You are welcome here." Are some phrases you can use. Come up with some of your own that keep you calm and accepting.