Accept and Witness
Call it a two step. No matter what comes up, however hilarious or horrible, do the two step: accept it and witness it.
You don’t have to act on it. You may think that you want to torture puppies. You likely will not actually torture any puppies. Hint: don’t torture puppies.
But also, from the Buddhist perspective, don’t judge yourself for having the thought. It’s just a thought. Thoughts are wispy and ephemeral, unless you grab them and make a huge story out of them. You are not a horrible person for having horrible thoughts.