In the instructions in MN 20 step 2 is to regard the thought as a danger and be horrified and repelled. MN 61, near the end has the most targeted instruction for a good wholesome purpose for the energy generated in the case when your subconscious brings up a mistake you have made in the past. that is to generate horror that you made the mistake, then repulsion from the area of the mind that allowed, or please forbid contributed to the mistake. Then dedicate the repulsion energy to future restraint. You can burn out your horror and repulsion muscles, go easy.