If it helps the OP, in my case to stay motivated, it must not be an overly repetitive or mentaly straining task.
Focusing more on walking/jogging since I'm focusing on weight loss, not building muscles just yet:
In a gym I'm always walking/jogging "on the same path", seeing the same things. Meanwhile, doing so around my neighborhood, I can pick different paths, focus on different things, change pace without harming the activity.
Plus being a bit of a shut-in, gyms often have more people than I can handle without stress kicking in. In my neighborhood, I know where and when there's more people so I can avoid.
For building muscles, still figuring that out since the usual method involves a lot of repetition in a place too dense with people.
But once I go back to focusing on that, what I think I could end up doing is something like marcenary, since that from what I've seen it seems to require some effort while having a more immediate objective which could help with motivation.