You speak in web terms that are not universally known. So no, you can’t “comment out” your thoughts, BUT you can however brainwash yourself.
First think of the shit you want to erase, yes it will suck but to bad.
Next you need to think of a memory to replace it.
You will need to stick both memories next to each other in your mind and then focus on the “good one”.
Make the good one more colorful and slowly start making it bigger than the other memory.
After it has filled your entire head with the new memory the old one will be devalued.
Repeat the process a couple times, your mind will never go back to the original memory without you trying to go back to it.