Ineffable Ontological Detanglement .: Introspective Assistance & Mental Analysis Manual
Intrusive thoughts are not a thing you can just declare "Doesn't matter, what matters is how I respond to them." In some ways you're right, what matters a lot more is how you act based on these thoughts, but, it's a thing to pay attention to.
People with a lack of perceptual filter bypass are obviously the most likely to have intrusive thoughts, perceptual filter bypass people will do it, the lower intelligence tier who allow others to construct their ego for them are very unlikely to do it.
I'm going to split it into two categories. One, things like random thoughts of hurting your pets springing into your mind, these things are just an instinctive "Pay attention to how much I don't want to do this, pay attention to how much I would hate it." They feel more dramatic and like they just SPRING into your mind because... You instantly pay attention to them because you hate them. Even within a life of meditative mental kung fu master semi-conscious self control you're still going to get these thoughts. Thoughts of hurting your baby may fall into this category, however, they may also fall into the second category.
The second category is the overwhelming overpowering ALERT thoughts that will often feel like they're coming from outside of you. Overwhelming thoughts of violence, sexual violence, all of the things you fear about yourself such as your inner disrespect for your own religion. There's a reason, there is in fact something inside of you that's giving you bursts of violent thoughts, it isn't the "Wouldn't I just hate myself if I did this" thoughts it's the deep down you may have some very violent things brewing, you're trying to repress them semi-consciously and they keep springing to the surface.
It's probably okay, even if you have an inner violent urge you're probably fine, even if you sometimes follow that urge in many situations you're probably still fine. Once dealt with, this burst of violent thinking will likely subside into something more subtle and underlying and comfortable and most certainly not the wretched torture murder thoughts they currently appear to be. If you panic about this kind of thing, there's a good chance you'll enter the thought racing spiral, you don't want that, so don't panic, just know that your mind is doing a thing and be aware of that thing, but chances are you don't need to worry about going absolutely out of your mind to the point that you're following through with the thoughts or you've broken to the point of hallucination and delusion. The thought racing will make you think this is where you're going and it gets worse and worse, and, it's a spiral, and it's a spiral that could well potentially possibly bring you to the places you don't want to be, and now the only reason you're there is because you panicked over the fact that you may get there.