How I feel motivation and agency (though I don't usually think of it in those terms.): When I want to remember why I am doing things, or not doing things, I think about what is important to me, what my priorities are, and how any particular course of action or non-action relates to those priorities.
However, the better question might be how to not act like a POS to people while you are feeling icky. That's probably the more useful skill to cultivate.