Friends:

 How to stop recurring Distracting Thoughts?
 

1: Redirect attention to a different advantageous object:
Like when driving out a coarse peg from a piece of wood, using a fine peg,
one can substitute, and thereby replace :
A: Desire for living forms with thinking about a disgusting rotting corpse...
B: Desire for inanimate things with thinking about their impermanence...
C: Aversion towards living beings with the mental release of friendliness...
D: Aversion towards inanimate things by noting their composition...
E: Delusion, doubt, uncertainty and confusion by thorough investigation...

2: Consider the Danger in thoughts mixed with hate, greed and ignorance:
These thoughts of mine are disgusting, dangerous, bringing much misery
now and later, just like a young man or woman is disgusted and humiliated, if
somebody hangs a rotting carcass of a snake, dog or human around their necks,
so should one regard these disturbing distractions!


3: Stopping all flow of thought by Non-Attention, and Non-Reflection: 
Like a man not wishing to see, closes his eyes, and turns away from the object.



4: Repeat reflection of the Root Cause of these Distractions:
Searching for the reason behind these mental afflictions can itself cure them: 
Like a running man wishes calm finding no reason to run, starts walking...
Then finding no reason to walk, he sits down.
Finding no reason to sit, he lies down, and is cured!

5: Beating the evil mind down with the force of the good mind:

By clenching the lower teeth against the upper teeth, and pressing the tongue up
against the palate, like a strong man holds down a weak man by the shoulders so
should one beat down mind with mind. Then these evil, ill and detrimental thoughts
rooted in greed, hate, and ignorance are eliminated, and they vanish.
By their evaporation mind settles down, becomes focused, concentrated, and unified
on the purely good thought only!


Attention Deficit occurs, when following after Distracting Thoughts!

Source: Moderate speeches of the Buddha: Majjhima Nikāya 20:
The Removal of Distracting Thoughts. Vitakka-santhāna Sutta.
The Removal of Distracting Thoughts Full text and commentary is here:

https://What-Buddha-Said.net/library/Wheels/wh021.pdf

Distractions disturb Delight!