The verb olvidar is most frequently encountered in a construction sometimes called se accidental.
- ¿Se te olvidó algo? Did you forget something? (asked of someone who had just returned)
- Se me olvidaba … Oh, I almost forgot … (but now I remember, going back to an earlier conversation subject)
- ¿Quién se me olvida? Who am I leaving out? (because I have accidentally forgotten about them)
The forgetting in this examples is unintentional. However, olvidar can also be used for intentional forgetting.
- Pues ya olvídalo. Forget about him. Get over him. Move on.
- No lo puedes olvidar así de fácil. It won’t be so easy to put it out of your mind.
Note that the grammar here is different; the se accidental construction is not used.
Asunto olvidado, literally, forgotten matter, is a stock way of saying that you have moved on from the problem under discussion.
— No lo vuelvo a hacer. I won’t do it again, I promise.
— Asunto olvidado. Don’t worry about it. That’s water under the bridge.
¡Cómo olvidarlo! is the go-to expression for expressing nostalgia.
— ¿Te acuerdas de cuando fuimos a la playa?
— ¡Cómo olvidarlo! Ah, I remember it fondly!
It is also possible to use this expression ironically or humorously to feign nostalgia for a negative experience. — Remember the time you stepped in dogshit? — Of course I do. ¡Cómo olvidarlo! As if it happened only yesterday.