Using tricks to commit to memory newly learned things. Some examples are word association, mnemonics, say it out loud, write it down, and visual cues.
Also, the following are questionable in my mind, but there are tasks and fun things that supposedly improve or maintain memory, like crossword puzzles, dancing, and basically anything that uses memory. Personally, I’m not so sure if it’s chicken or egg, but if it’s fun then it can’t hurt. There are studies about it showing strong correlations.
I find as I get older I’m not as focused on little things. If I really focus on whatever it is I need to remember and cancel out all the other garbage that can be going through my head at any given moment, it helps me remember whatever is in front of me.
Lastly, I think stress and depression significantly impact memory. This is just my opinion I don’t know the science.
Edit: some medications impact memory.