Human thought is funny.
We can’t control every thought that pops into our heads. Nor can we always discern the source. I believe our minds are somewhat permeable no matter how much attention we give them.
Mindfulness is where it’s at. We don’t necessarily need to look at a thought and wonder, ‘where did this come from? Is it a demon? Is it me? Is it something else?’
What we need to do is learn to let go of such thoughts.
You are not your thoughts. I used to identify myself with the way I thought, so I would have good days and bad days. If my thinking was mostly positive that day, it was a good day. If not, it was a bad day.
I had a lot more bad days than good, while I was thinking that way.
Centering Prayer is a meditative practice that helped me a bit with this. In CP you spend 20 minutes a day (or ten, or however much you can manage), in doing nothing but letting thoughts go. A thought comes, you let it go. Another thought comes, you let it go.
I didn’t stick with Centering Prayer for very long, but it did help with the mindfulness factor.
I learned to value being instead of thinking. Breathing, and just living, instead of relying on the ping-pong of neurons in my skull.
I spend a lot of time in the intense presence of God. Sometimes it’s so intense I feel inebriated. Other times it’s more subtle.
When God resolved my loneliness problem, it was in the presence of such concentrated Presence, what I would call a spiritual ecstasy, that a negative way of thinking broke, and I was able to discern the mind of Christ.
(I see the mind of Christ as being not merely a condition of thought, but a spiritual place that we can ‘live, move, and have our being’, as well as a continuously-available source of reference to our actual, in-Christ selves.)
Now, when a thought comes my way, I can detect whether it sounds like the mind of Christ or not. If it doesn’t feel right, I let it go past me.
Sometimes, particular thoughts are more insistent than others.
But I see those thoughts as being outside me, not inside, and I don’t let those thoughts control me any more. I hear the thoughts either knocking on the door politely, or banging on my door violently, but whether subtle or insistent, I ignore them and turn inside to the presence of God, and the thoughts go away. I stayed at peace while the intruding thought made itself known, and I rejoiced when it left.
There is an adage, ‘you can’t stop a bird landing on your head, but you can prevent it from building a nest in your hair.’ We can’t entirely prevent strange thoughts from popping into our head. What we CAN do is be mindful of such thoughts, and refuse to let them wreak havoc in our lives.