The Vitakkasanthana Sutta (MN 20) (The Removal of Distracting Thoughts) is the 20th discourse in Majjhima Nikaya of Pāli Canon in Theravada Buddhism.
In the Theravadin Tipitaka, the Vitakka-saṇṭhāna Sutta is the twentieth discourse in the Majjhima Nikaya (MN) and is thus often designated by "MN 20"; in the Pali Text Society (PTS) edition of the Canon, this text begins on the 118th page of the first volume of its three-volume Majjhima Nikaya (M), and is thus alternately represented as "M i 118".
In the language of one translation, when the mind has become filled with hatred or illusion by dwelling on a bad ("adventitious") object, the aspirant (bhikku) should replace the bad thought with a good ("skilled") thought (Pali: tato nimittato aññam nimittam): Like an experienced carpenter or carpenter's apprentice, striking hard at, pushing out, and getting rid of a coarse peg with a fine one, should the bhikkhu in order to get rid of the adventitious object, reflect on a different object which is connected with skill.
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.
[3]: 212 The fifth approach (Pali: abhinigganhitabbam; Sanskrit: abhinigrahā),[6]: 143 to be pursued when the fourth and all previous approaches together fail to eliminate negative thoughts, is to clench the teeth and "subdue and beat down the (evil) mind by the (good) mind",[2] just as one man may do physical violence to another man.