How good are your sleeps? Are you drinking enough water?
I know that I get brain fog if I sleep poorly or forget to drink enough water.
For coding, I try to explain to myself exactly what I am trying to solve using the most simple explanation possible.
Usually, the program will perform a series of steps. I work on each step, in code, until I solve that step. Then I move on to the next step. Divide and conquer.
Like the other person asked, have you sought out professional help for any possible medical issues? If you have ADHD then a professional can give reliable guidance on how to compensate for the main ADHD symptoms.
Good luck! You CAN do it!!!
If that is a real product, could someone tell me what it is so I can research it?