The process for how humans make & access memories isn't totally understood. Recent research seems to indicate that memories are stored in distinct events in different areas in the brain depending if the memory is part of an ongoing inner narrative or considered a separate event. They classify these into boundaries and investigate how those event cells and boundaries interact.
They theorize that events and boundaries may be triggered by dopamine, leading to interesting new ways to treat medical and mental health conditions.
In terms of practical use of memories in helping toddlers to build resilience, research seems to show that parents who provide "living memories" of a child's development with stories, called "elaborative reminiscing," help build a deep resilience to protect against depression and anxiety in teen years.
This richer store of memories provides autobiographic material to build a sense of self that may prevent stressors from having such a negative effect.
Interesting food for thought is how to incorporate this type of self-communication might help adults heal from a traumatic past into therapy.
For a deeper exploration of these principles, look at: