It happens to all of us, to some degree or another, as we age.
As said, use it lose it! Used to laugh at people doing crosswords, not any more, a means of keeping the brain occupied and active.
Spend time working out how to do things, what to make, most effective sequence to do things or go anywhere.
Various, in UK and elsewhere, studies have shown that regular sex enhances cognitive ability.
So keeping mentally and physically active has to help.
But, we are all different, so while marathon running, or the Times crossword, may be ideal for one it may not do a lot for you. You have to try to find out, just like tasting food to find your favourites.