Little wins keep you going. Little wins keep morale up, especially in the face of big setbacks.
You can choose to structure your work in a way that recognizes small progress points. Those are little wins. Just paying some attention to them will help keep you going when you hit hurdles.
You can break a large project down into small milestones on the path to finishing the bigger thing. Each one represents progress, a small victory, a reason to keep going.
If you don’t have a goal in mind, merely a direction, you can still use this. You won’t be breaking a big project down into smaller pieces of work, but taking steps in a concrete direction and evaluating their results. Learning is progress, too.