Patanjali says: ‘Vitarka-badhane pratipaksha-bhavanam; to obstruct thoughts which are inimical to yoga, contrary thoughts should be brought.’ By constantly thinking good thoughts, the whole of our thought-structure can be transformed. The unconscious mind is like a fertile field: whatever idea is planted in it immediately strikes roots and grows.
When good thoughts are planted, the inner resistance to
spiritual life gets progressively less. The mind, which once was a kind of
relentless enemy, now becomes congenial. It is greatly beneficial to always
have a stock of holy thoughts and mental images to resort to whenever
undesirable thoughts or feelings arise and try to find expression in mind and
body. It is important to do this in a deliberate and systematic way.
Japa, meditation, prayer, and repetition of some elevating
passages are to be practised regularly, even if the mind is in a restless state.
Somehow or other, one has to learn to raise a strong countercurrent of
spiritual thought during critical moments. By following this technique one can
mentally insulate oneself from impure imagination, thoughts, and attractions.
Changing Our Attitude towards the Object of Attraction
For example, if the
thought of a woman rises in the mind of a brahmacharin (celibate), he can
associate that form with the image of the Divine Mother or with the form of his
own mother.
A celibate woman can follow the same process by replacing
the form of her attraction with that of a divine personality, or with the
thought of her father or brother.
The cultivation of the feeling that all women are mothers
and all men are sons is very difficult indeed; but the positive effect of this change
of attitude towards the person that attracts the mind is almost immediate. One
may fail several times, but celibates have to tenaciously proceed with this
attitude. Gradually, the old mind is destroyed and the new mind is fortified.
Iron resolve and fiery determination make it possible.
Source - excerpts from article titled 'Brahmacharya and Its Practice' by Swami Yukteshananda published in the Prabuddha Bharata Magazine January 2010 issue.