I don't know the particulars behind that question in terms of the thoughts, but I can tell you some of the common patterns of thinking that a person might struggle with. You are in the kitchen with your infant daughter, and you have the sudden thought, "Pick up that knife and stab her through the heart." You're horrified by that thought, because you love your daughter. But where does that thought come from? So that might be one thing.
Or you've gone to the hardware store to buy some rope in preparation for a camping trip, and you get the sudden thought you should make a noose and hang yourself, but you're not depressed, you're not anxious, you're not suicidal in any way. So how do you handle that thought? What does it mean?
Or you're in the middle of a worship service and you're singing, and all of a sudden you get this thought, you're not a child of God. You're lost for eternity. Okay, how should we handle those thoughts? It's understandable why they cause distress for us as believers, but a couple things I think are helpful.
One is that the mere presence of a thought doesn't necessarily mean that it reflects our true heart's desire. In fact, your being upset over the presence of the thought is a sign of that. Secondly, the majority of people, even Christians, will have these kind of intrusive thoughts from time to time. It's a very common experience.
We tend not to talk about it because it feels hard to say that to someone. But if people are honest, the majority of us have had a thought like that. And so the best way to handle that is to say, "I don't know where that came from, Lord, but I know that's not true of my heart's desire. Help me just to move on."
In that moment, what's more important than the content of the thought is what you do with the thought, how you are viewing the thought, and then what you do in response to that thought. So if you start thinking, "How could I have such a horrible thought? What does that say about me as a person? Could I actually do that kind of harm to my child? What's wrong with me?" And that causes anxiety. And that can lead to this cycle where the anxiety begets more intrusive thoughts and more anxiety.
And if you find yourself in that kind of a cycle, with that kind of anxiety, it would be important to seek out a trusted friend, or a counselor to work through those issues of anxiety.