I have type 1 diabetes and on bad days really struggle with brain fog.
Make sure you have all your tasks written down and organised, ideally in some form of project management software.
Things get easier the more programming you do. Once you’ve called a method for the 10,000s time you won’t need to think about it.
I find ChatGPT is really good for reminding you of syntax and things like that. No matter how many times I do it I can’t remember the ordering in a c# switch expression so I just ask for the syntax.
Might be easier to use a capture card or similar to just record your pc.