You cannot remove any thought. Suppose you don’t want anything in your room. You can clean out the whole room, throw everything out. But you cannot do that with thoughts; once they come to you, they are your property, whether you like it or not. Good, bad, or indifferent, all thoughts are there with you. How they are handled is up to you.
Purifying the mind means making [instinctual] thoughts
ineffective. How? By detachment, that is all. Don’t pay attention to the thoughts, don’t be interested in them; they
will all lie down, sleep. If you pay attention, if you are interested, they will come up. That is why often
in your idle time, leisure time, you enjoy or are miserable — because you dig up
thoughts from the past, even though you know that you are wasting your time.
Raja yoga gives you the art of controlling thoughts, making
them ineffective. Patanjali speaks of constant practice and dispassion. What is
constant practice? Constant awareness of the pure Being, the Purusha. Put the
mind on the pure Being, don’t be interested in any other thought. Thoughts do
come, but don’t pay attention to them. Thoughts arise because of some
suggestion outside. They don’t come without a suggestion. There are millions of
thoughts in your mind now; why don’t all of them come up? They arise according
to the external suggestion. Something is seen outside — outside of the mind — from
inside a thought arises, and you are a victim. From the external suggestion,
internal urges come up; they play games, and you are in between, a victim.
Patanjali tells you: ‘Control them, control them, control
them.’ When you control them, a time
comes when all of them are rendered ineffective, almost dead; [or remain] in
their unmanifested condition. They are almost dead; they do not manifest. The
unmanifested condition is called the second stage of samadhi — the thoughts are
there but they do not disturb you. This stage is called the state of no-mind.
In this mind there is no pulsation, no impression, no thought, no urge, no
modification.
Source - Light on Patanjali – IV by Swami Sarvagatananda published in Prabuddha Bharata Magazine November 2008 issue.