Moderate stress helps us recall information which is helpful when we are intentionally trying to retain information such as studying for a test. Long term stress damages our abilities to hold onto facts (both how we store this information within our brains and how we retrieve it). Reason being that stress does not help us retain information because our hormones being released by our sympathetic nervous system are causing us to react rather than respond; The notion of fight, flight, or freezing. This is where the idea of blanking on a test or blanking out memories comes to into the equation. Our brains are attempting to protect us from the stress responses.
Becoming aware of this impact for ourselves is an important first step.
When working on trying to retain information placing yourself into an environment similar to the one that you need to perform in is ideal. Exercise helps with sleep and regulation. Deep breathing exercises allows us to calm our sympathetic nervous system and resulting in lowering our stress hormones in the moment.
Surprising link between stress and memory-Elizabeth Cox (2018).