Depression and anxiety can impair concentration and memory — sometimes mimicking cognitive decline. Treating the underlying mood condition often improves the cognitive symptoms.
If low mood or anxiety is affecting your thinking, speak with a doctor or mental-health professional. It is treatable, and clarity often returns.