When life is rough, I try to see at least something through an optimistic viewpoint. It could be work, play, family, friends, self-gratifying behaviors.
The 'self-gratifying behaviors' part of the answer might not sound like it makes sense though. I just don't think all self-gratifying behaviors are bad -- like eating or reading or sex. Too much is bad though, obviously. Being too gratifying to yourself is gluttonous -- and not just with food. Addictions arise that are seriously hazardous.
To persevere, I also summon the courage otherwise left in the dust to try to accomplish the task at hand.