As nice as it would be, not everything you work on will be enjoyable. In fact, many of the core elements of a project will actually be the hardest parts that you avoid like the plague.
I call these the "unpleasant essentials".
These "unpleasant essentials" are responsible for deaths of an infinite number of projects (my own included). They're the things we procrastinate in to infinity. They stop momentum right in its tracks.
The key to overcoming these unpleasant essentials isn't willpower, it's planning.
It's deciding "this is where I want this project to end at" and then working your way backwards, step-by-step, to figure out what needs to get done. When you plan this way, you aren't thinking, "I really don't feel like designing this settings page" or "optimizing this SQL query will kill me". You're thinking "here are the steps to get to where I want to be".
Then you follow the steps.
The goal isn't to avoid unpleasantness, it's to reduce decision fatigue. You front load all the major decisions and then simply follow the plan. The end.