Hi! Whenever a thought like that goes in your head! Just accept that you had the thought, everyone has them, and don't give it any more power! I know its easier said then done, but if you said you never would, you wont!
something that helped me was realizing this: if i’m so worried about a harm thought, that truly means i don’t want to do it, so then i’d think “it’s not me, it’s my ocd.” just thought i’d share, hope this helps & feel better :)