I believe S.K. is correct in his description here of the mechanics of memory.
To forget — this is the desire of all people, and when they encounter something unpleasant, they always say: If only I could forget! But to forget is an art that must be practiced in advance. To be able to forget always depends upon how one remembers, but how one remembers depends upon how one experiences actuality. The person who runs aground with the speed of hope will recollect in such a way that he will be unable to forget. Thus nil admirari [marvel at nothing] is the proper wisdom of life. No part of life ought to have so much meaning for a person that he cannot forget it any moment he wants to; on the other hand, every single part of life ought to have so much meaning for a person that he can remember it at any moment.
-Soren Kierkegaard, Either/Or, EK p.56
The wise advice amounts to “don’t take anything that happens TOO seriously, lest you discover later that you wish to forget it. On the other hand, still try to take life somewhat seriously. There are lots of things you may wish to remember too.”