I imagine writing the details of the unpleasant thought or image down in vim. This converts the thought to "something I am observing" vs "something i and xperiencing."
Then the ritual plays out, where inmagine the same sequence of events: saving the file in vim to disk. Copying the file to a USB memory stic. Putting that stick into a ziploc back. Putting that bag into a specific pocket in my backpack. Getting my backpack and getting on my bike. Biking from my old apartment (where I lived when I developed this technique) and bike down 101 to moffet Air Force base, where I throw the backpack into a conveyor chute to a rock, which launches the backpack into space.
Sometimes I had to repeat the ritual a few times, but afterward, the image or thought recedes in intensity.
I could also see it used for both a lie detector and a biofeedback tool to defeat its use as such.
But what really comes to mind is the final scene in Firefox wherein Mitchell Gant has to subvocalize in Russian to fire the rearward missile on the fancy Russian jet he's stolen.
The idea of having a brain-computer interface recording this activity is an absolute non-starter for me.
But then again, maybe this would all normalize some of my own mental activity, if it was more public how strange everyone's minds can act at times.