TL;DR - Three things: a cozy zero-friction environment, a lot of volume, and goals based on inputs you control.
Make your environment cozy. Invest in the place where you learn, study, and work. Keep it clean, not messy. The goal is zero friction: you sit down and start working on what pushes you forward. That's it.
Do the thing a lot of times. After enough volume - coding the backend, the frontend, whatever you're learning - the thing becomes easier. And when it's easier, you enjoy it more. Enjoyment is downstream of competence.
Set input goals, not outcome goals. "I want to make more money as a software dev" is an outcome - you don't control it directly. The input version: look for another contract, add one more project to the portfolio, get five users to sign up. Simple goals you can actually achieve. Stacking those inputs is what causes the quantum leaps you want - and hitting them builds real self-belief.