As you do more and more spiritual work, especially meditation, you learn to detach yourself from the noise generated by your negative ego. You cease to participate in them, you stop taking them personally, and you see that you are not those thoughts. Once you have achieved this with even a little mastery, you can start to focus your will to change how you think.