My health varies unpredictably; some days I'm not really fit to be out of bed, some days I'm pretty good.
Bad days, if I feel i can try working on something, I tend to stick to smaller "side" parts of a bigger task. Grooming dotfiles, editing docs, that kind of thing. Limit the possible impact of mistakes, and do things more amenable to non-thinking "change and try again" approaches.