The Vitakkasanthana Sutta
In this sutta, called “Removal of Distracting Thoughts,” MN 20, five methods are taught by the Buddha to overcome unwholesome and distracting thoughts during meditation. They are: replacing an unwholesome thought with a wholesome thought; examining the danger of the distracting thought; forgetting the thought; stilling the unwholesome thought formation; crushing mind with mind to forcefully drive away the unwholesome thought.