When you find yourself trying to remember a show (or any works) that's on the tip of your tongue but just out of reach, come here - the collective brain of the TVTropes community can probably help. Post all the details you can remember (examples help). If you're looking for a trope, head over to Trope Finder. Have general questions about tropes? Visit Ask The Tropers!
You might be thinking of, for instance, the biography of Terry Pratchett - Terry Pratchett: A Life With Footnotes, which was written by his longtime personal assistant Rob Williams. The second half of the book describes Pratchett's diagnosis of Alzheimers, and the inevitable deterioration of his competences and faculties. Pratchett was wholly aware of this and continued writing and preparing books almost all the way to the end.
Edited by AgProv Elderly curmudgeon and awkward person. Professional old fart.

It's a non fiction about the writer and his teacher or mentor, a very intelligent man who's mind and memories are fading because of dementia. He gets progressively worse and he even knows it. I read about it on Tear Jerker.