For example, I recently had to learn a desktop programming toolkit in Python, which I found very tedious and uninteresting. But knowing that I was doing it to help a team of engineers design a new kind of lightweight electric vehicle really drove me to put my heart in it.
Even when your project isn't aiming for such impacts, just putting (good) food on the table of your family can be a motivation I guess.
That said, what forces you to follow fads? I've basically stopped doing it when I got started with Clojure about 6 years ago and it's been fine. It does take some convincing to use that for a project sometimes, but the feeling of empowerment has not faded, and compared to JavaScript churn the still waters of the Clojure ecosystem are quite enjoyable. My point being, fads are not necessarily a fatality.
This could mean a temporary break or more drastically, career altering. Many people have the power to shape their life, but they choose to keep going in one direction because of how much time they invested. Even when that direction no longer aligns with them.
In terms of success: I have dozens of side projects lying around, some of them educational, some practical, most unfinished.
It is completely fine, even beneficial to do so. At work you are already forced to finish and maintain stuff. Giving yourself some free, playful space balances this out.
Also in time some of those things trickle down (quasi) to your day job, or at least it has for me repeatedly. Not in the exact form I was expecting, but in tangible ways nonetheless.
There are two things that eventually keep me “on track” when I have a low phase: reminding myself that I’m a creator with ridiculous power at my fingertips is one. I keep a collection of notes with interesting and fun ideas (together with a friend). The other is more like a safety net so to speak: I seek long term financial security. This is one helps especially when I think about people close to me and how I can be strong for them.
Most people tend to assume that they have a fixed amount of energy, motivation and ability for their work, and don't realize how much these can be inflated by positive emotions.
This is where a musician finds the perseverance to do the technical exercises that get her to playing a piece. And where a budding scientist finds the patience to work through a complex topic in spite of all the overwhelming conceptual hurdles. And where a programmer gets the motivation to learn arcanes of some obscure tool.