Encoding depends upon connections in parts of the brain, which in turn depend upon connections in experience. An event with a strong emotional component is more likely to be remembered than one with no emotional component because emotional memories are recorded in one part of the brain while visual components are recorded in another. Neural connections link them. We are likely to remember dreams if we wake shortly after they occur. Even so, if we do not encode the dream by making some effort to remember it, we are likely to forget it.
Some people assist memory by getting up and writing down the dream.
Others find that an easier method is to stay in bed and create some associations. The easiest association is made by giving the dream a title and a purposive description. Perhaps the most curious quality of dreams is that most of us most of the time are not aware that we are dreaming while we are dreaming. The prefrontal cortex lies near the front of the brain and is where the planning of behaviour and self-awareness reside. By dampening activity in this region, a person might not realise that impossible or bizarre events in a dream are unreal.