How do you master (control) your mind with buddhism Im a hindu and dont know much about buddhism, many people say that buddhism is the art of cultivating the mind which I feel includes methods to control and discipline the mind, I have a poor control of my mind, I cannot concentrate on any work for a good amount of time as my mind keeps wandering away. Im addicted to pornography, I watch porn everyday and masturbate because of which my penus hurts. I want to stop this habbit but cant. I try not to watch porn but my mind keeps driving me to watch porn. These are not the only problems, Im facing lot of problems in my life caused due to lack of control of my mind. I know buddhism suggests meditation for the control of mind. Is that enough or what are the other ways and methods to master the mind according to buddhism.
One can master the Mind by gaining experiental knowledge about The Five Hindrances and when to apply the corresponding five remedies to them.
The five remedies, can be found in the The Noble Eightfold Path, p. 63-66, by Ven. Bhikkhu Bodhi, and are as follows:

Replacing the hindrance with its opposite, e.g. replacing hatred/ill-will with thoughts of loving-kindness.
Contemplating the arisen hindrance as vile and ignoble, since it has entered the mind without permission or any control.
Shifting attention away from the hindrance.
Shifting attention onto the hindrance and thoroughly contemplating it by investigating its causes and conditions for arising together with its characteristics.
Removing the hindrance with force, just as a strong man would pin a weaker man to the ground.

The Buddha says in the quoted sutta below, that if one learns how to use and apply these five remedies then one will no longer be the subject of the mind. One will become it's master;

&quot;... This bhikkhu is then called a master of the courses of thought. He will think what- ever thought he wishes to think and he will not think any thought that he does not wish to think ...&quot;.



The Blessed One said this:
&quot;Bhikkhus, when a bhikkhu is pursuing the higher mind, from time to time he should give attention to five signs. What are the five?
(i) &quot;Here, bhikkhus, when a bhikkhu is giving attention to some sign, and owing to that sign there arise in him evil unwholesome thoughts connected with desire, with hate, and with delusion, then he should give attention to some other sign connected with what is wholesome. When he gives attention to some other sign connected with what is wholesome, then arty evil unwholesome thoughts connected with desire, with hate, and with delusion are abandoned in him and subside. With the aban- doning of them his mind becomes steadied internally, quieted, brought to singleness, and concentrated. Just as a skilled carpen- ter or his apprentice might knock out, remove, and extract a coarse peg by means of a fine one, so too...when a bhikkhu gives attention to some other sign connected with what is wholesome...his mind becomes steadied internally, quieted, brought to singleness, and concentrated.
(ii) &quot;If, while he is giving attention to some other sign con- nected with what is wholesome, there still arise in him evil unwholesome thoughts connected with desire, with hate, and with delusion, then he should examine the danger in those thoughts thus: 'These thoughts are unwholesome, they are rep- rehensible, they result in suffering. When he examines the danger in those thoughts, then any evil unwholesome thoughts connected with desire, with hate, and with delusion are aban- doned in him and subside. With the abandoning of them his mind becomes steadied internally, quieted, brought to singleness, and concentrated. Just as a man or a woman, young, youthful, and fond of ornaments, would be horrified, humiliated, and dis- gusted if the carcass of a snake or a dog or a human being were hung around his or her neck, so too...when a bhikkhu examines the danger in those thoughts.. .his mind becomes stead- ied internally, quieted, brought to singleness, and concentrated.
(iii) &quot;If, while he is examining the danger in those thoughts, there still arise in him evil unwholesome thoughts connected with desire, with hate, and with delusion, then he should try to forget those thoughts and should not give attention to them. When he tries to forget those thoughts and does not give atten- tion to them, then any evil unwholesome thoughts connected with desire, with hate, and with delusion are abandoned in him and subside. With the abandoning of them his mind becomes steadied internally, quieted, brought to singleness, and concen- trated. Just as a man with good eyes who did not want to see forms that had come within range of sight would either shut his eyes or look away, so too...when a bhikkhu tries to forget those thoughts and does not give attention to them...his mind becomes steadied internally, quieted, brought to singleness, and concentrated.
(iv) &quot;If, while he is trying to forget those thoughts and is not giving attention to them, there still arise in him evil unwholesome thoughts connected with desire, with hate, and with delusion, then he should give attention to stilling the thought-formation of those thoughts. When he gives attention to stilling the thought- formation of those thoughts, then any evil unwholesome thoughts connected with desire, with hate, and with delusion are abandoned in him and subside. With the abandoning of them his mind becomes steadied internally, quieted, brought to sin- gleness, and concentrated. Just as a man walking fast might con- sider: 'Why am I walking fast? What if I walk slowly?' and he would walk slowly; then he might consider: 'Why am I walking slowly? What if I stand?' and he would stand; then he might consider: 'Why am I standing? What if I sit?' and he would sit; then he might consider: 'Why am I sitting? What if I lie down?' and he would lie down. By doing so he would substitute for each grosser posture one that was subtler. So too...when a bhikkhu gives attention to stilling the thought-formation of those thoughts...his mind becomes steadied internally, quieted, brought to singleness, and concentrated.
(v) &quot;If, while he is giving attention to stilling the thought- formation of those thoughts, there still arise in him evil unwholesome thoughts connected with desire, with hate, and with delusion, then, with his teeth clenched and his tongue pressed against the roof of his mouth, he should beat down, constrain, and crush mind with mind. When, with his teeth clenched and his tongue pressed against the roof of his mouth, he beats down, constrains, and crushes mind with mind, then any evil unwholesome thoughts connected with desire, with hate, and with delusion are abandoned in him and subside. With the abandoning of them his mind becomes steadied inter- nally, quieted, brought to singleness, and concentrated. }ust as a strong man might seize a weaker man by the head or shoulders and beat him down, constrain him, and crush him, so too...when, with his teeth clenched and his tongue pressed against the roof of his mouth, a bhikkhu beats down, constrains, and crushes mind with mind.. .his mind becomes steadied inter- nally, quieted, brought to singleness, and concentrated.
&quot;Bhikkhus, when a bhikkhu is giving attention to some sign, and owing to that sign there arise in him evil unwhole- some thoughts connected with desire, with hate, and with delu- sion, then when he gives attention to some other sign connected with what is wholesome, any such evil unwholesome thoughts are abandoned in him and subside, and with the abandoning of them his mind becomes steadied internally, quieted, brought to singleness, and concentrated. When he examines the danger in those thoughts...When he tries to forget those thoughts and does not give attention to them...When he gives attention to stilling the thought-formation of those thoughts...When, with his teeth clenched and his tongue pressed against the roof of his mouth, he beats down, constrains, and crushes mind with mind, any such evil unwholesome thoughts are abandoned in him...and his mind becomes steadied internally, quieted, brought to singleness, and concentrated. This bhikkhu is then called a master of the courses of thought. He will think what- ever thought he wishes to think and he will not think any thought that he does not wish to think. He has severed craving, flung off the fetters, and with the complete penetration of con- ceit he has made an end of suffering.
-- The Middle Length Discourses in the Majjhima Nikaya, MN: 20, Bodhi Translation