I've tried many, many things, because my main problem is that I'm not passionate enough to learn something on my own.
When you have passion, learning flows freely in your mind, and you don't need much discipline.
But when you're not a natural, you need to create passion through discipline.
So far, what's been successful for me is :
1. Set ONE very specific goal upfront : for instance, "finish this coursera course completely until I get the certification"
2. Only go through courses that are self-contained, straightforward, and that have at least 60% practice for 40% theory. (youtube videos & books are great when you already have that passion and interest in a subject, but if you don't, you'll just waste your time and energy unless the book is really well written and entertaining)
3. 20min a day, every day. You can do more, but you cannot do less. Set an alarm clock, turn off notifications, and just go through these 20 minutes, even if you don't make progress
It doesn't matter if you don't make any progress during these 20 minutes : what matters is that you get into a habit.
This concept is very well-known : https://en.wikipedia.org/wiki/Kaizen
After 3-4 weeks, if you keep at it, you WILL start enjoying it, and you WILL create some passion inside you.
When you start enjoying the learning process, you'll start getting your results.
4. Give yourself some gratification for doing the work : I use the application "way of life" https://wayoflifeapp.com/. Every day when I go through the 20minutes, I mark a green check on the app, and it's sufficient to make me feel good about it. If I don't do the work, I mark a red check, and it makes me feel bad, so I really want to avoid that :)
Good luck !