As with humans as your pet ages sometimes their brain does not process things as well as it used to so sometimes they can appear more confused or disorientated or forget some of their basic training. There may be contributing factors such as poor eyesight or hearing or their joints ageing.
Veterinary diets and supplements are available and some prescription medicines too to help with this so seek your vet’s advice if you notice any of the above and they can recommend what you try. The supplements often contain antioxidants, B vitamins, Gingo biloba and omega 3 fatty acids. There are other compounds sometimes included too. Supplements have been anecdotally thought to help although there is no evidence based research to confirm this.