Despite having spent late nights ruminating over stupid things you've said, it is actually possible to make yourself forget bad memories. In fact, not only is it possible, but the brain actually has two very different systems for doing it.
In a study, scientists asked volunteers to memorize associations between pairs of words, and then attempt to forget them. Then they observed this forgetting process while the subjects did it.
What they found is that if you want to get something unpleasant out of your memory, there are two ways to go about it. You can directly surpress the memory every time it emerges, or you can use substitution to overwrite it with something else.
Write the researchers:
One mechanism, direct suppression, disengages episodic retrieval through the systemic inhibition of hippocampal processing that originates from right dorsolateral prefrontal cortex (PFC). The opposite mechanism, thought substitution, instead engages retrieval processes to occupy the limited focus of awareness with a substitute memory. It is mediated by interactions between left caudal and midventrolateral PFC that support the selective retrieval of substitutes in the context of prepotent, unwanted memories.
Both are effective, and both can drive unwanted thoughts away, but work in completely opposite ways. And, since some people might be better at one than the other, this provides an alternative if there's a niggling memory of your actions that you just can't seem to dispel.
Image: Current Biology, Benoit et al.