I don't have any reliable quick fixes unfortunately. Personally it kinda feels like my brain is unable to engage when that happens. Sometimes something like music or quotes or things that stir emotion will lift it a bit? Sometimes easy puzzles like sudoku or nonograms will be enough to make it more functional again? My friend uses caffeine to help themself. Nothing has worked consistently, but in general finding smaller easier ways to engage my brain can coax it into improvements.
Again I want to emphasize that there are plenty of times where I'm unable to really try due to how bad it is or I manage to try, but it doesn't work. Not to say it's pointless to try, but to highlight the fact that it's hard and you're not deficient in any way for struggling with it.
I'm sorry you lost your job because of it.