There's only you in your head right? So I assume it'd be you showing yourself that this other entity in your head is only imaginary. Unless you think I suppose other entities inhabit your mind.
I was being humorous, but.........
We are separate persons because (even though we are all part of the same whole and made of the same thing) there are borders between our minds which are by specific arrangement.
However, our "separate" minds can be affected in many ways which make them not quite as separate as we might like.
Knowledge of how the mind works can enable someone to manipulate others and "get in their head" that way.
It is also not impossible that a mind may be affected more directly.
It's been shown that cell phones, etc, disrupt mental processes -but using signals to affect things more specifically is also possible (mind-reading tech, etc.).
In the bible, Satan is called "the
prince of the power of the air, the spirit that now worketh in the children of disobedience".
Spirits are said to be able to influence humans (and can lend that ability to those who do sorcery).
Things such as dissociative identity disorder show that one separate mind may be split into different personalities -and being affected by spirits would be similar, though the influence would be from a separate being/mind.
Whatever the case, it's good to rule your own spirit, know yourself well and realize some sort of influence from others is possible -and and be vigilant.