While I can't diagnose your condition, I can sympathise with your feelings. Brain fog can be a horrible experience to suffer, with the loss of concentration both distressing and depressing. I'd certainly echo what others have said about going to see a doctor to find the root of the problem.
My current brain fog is down to chemotherapy which should hopefully wear off within the next few days but prior to this, I was on extremely strong medication for my brain tumour that turned me into a zombie for months. I still can't believe how much time I've wasted just staring off into space or looking at a blank wall, while my brain struggled to form thoughts or communicate with the rest of my body. Even now I still have moments due to the brain damage (I have a decent chunk of my brain missing).
This makes me depressed because as a podcaster I was known for my fast jokes and my articles were popular for possessing sharp wit. Now I'm slow to develop thoughts, people think I'm dumb when I talk because it takes a little longer than normal for me to put what I want to say into words. I also struggle to maintain concentration on difficult tasks and can feel my head going blank during the middle of conversations.
Hopefully you won't be as bad but if you ever want to vent about brain fog, by all means I totally understand.