We are not machines. Some days we are going to be better at the same task than other days.
You see this with professional sports players and you see this with professionals in IT too.
Except in our jobs we often have the luxury of being able to focus on other activities on the off day. To use a sports analogy, it’s like playing the defensive game when your attacking game isn’t there that day.
But the most important thing one can do on an “off day” is to not push yourself too hard otherwise you’ll burn out and be “off” the following day too. That applies emotionally as well as physically. Don’t get upset that you’re struggling one day because tomorrow is a new day.
Personally I try to take on tasks that don't require as much brainpower. If I'm really too tired I'll just take a nap, because it's better to take a 20 minute nap and do work for the rest of the afternoon than feeling terrible and doing hardly anything for a whole afternoon.