Stress affects memory due to high cortisol levels
Cortisol is important when it comes to keeping you alive. Your adrenal glands secrete cortisol when your blood sugar is low and when you're stressed. That's ok if stress comes in short bursts, but when it's an ongoing state, those high levels of cortisol can be corrosive (metaphorically) to the brain.
When someone is stressed, cortisol is released to help them get through that event as a chemical boost for survival.The problem is when you stay at high levels of stress, you get an over influx of cortisol. Research has shown this leads to short-term memory loss.
High cortisol levels makes synapses , the places where neurons connect and transmit chemical bits of information known as neurotransmitters, shrink and disappear. When a person is stressed, two things happen, first, they're often affected by lack of sleep and/or poor nutrition, both of which are necessary for the brain to work optimally. and second, the brain is preoccupied by whatever is causing the stress, taking up precious mental energy that would normally be used toward needed memory storage.
You need to address what is causing your stress and learn coping strategies such as mindfulness and yoga.