Sometimes I remember the wrong thing. I don't just mean an irrelevant thing or an incorrect thing, but literally the exact opposite of the right thing. For example, the order of arguments to
ln, or which way to turn the lock on my bathroom door. And in those situations I often do the most mistaken and counterproductive thing to fix the problem: I think "okay, I'll just remember that it's the opposite from the way I expect". As soon as I think that, I'm doomed to a miserable cycle of doing the (correct) opposite, my expectations reversing, doing the (wrong) opposite and then getting hopelessly confused.
I like to think of the brain as being mostly an association machine: a thing happens, another thing happens, and those two things become more strongly associated. This fairly simple mechanic seems able to produce an amazing breadth of capabilities, from the more obvious pattern matching to the vastly less obvious statistical estimation. But there's one particular task this association machine is pathologically bad at: disassociation.
This is the classic problem of trying to not think about elephants: as soon as you're thinking about not thinking about elephants, you're thinking about elephants. There's no mechanism for us to build an disassociation, or break down an existing association. This leads to problems not just with elephants but with all sorts of situations: when you learn bad habits, it's hard to un-learn them; when you break up with someone, it's hard to stop thinking about them; when something traumatic happens, it's hard to forget it.
Worse still, in our attempts to create a dissociation, we instead end up creating the closest equivalent: a negative association. So we can't stop thinking about elephants, but we can say that people who think about elephants are idiots, and thus make thinking about elephants painful by association. But it's important to realise that a negative association is still an association! And building a stronger and stronger negative association only makes the thought more frequent, and the negativity more painful.
As far as I can tell, there is no way to un-make an association. The best we can do is make some other, stronger association override it. Instead of thinking about how much of an idiot you are for thinking about elephants, the better approach is to think about leprechauns.