There's a lot to this question, and there are a lot of suggestions I can make.

First, we all have a choice which thoughts we will entertain and which ones we will shut down. We can intentionally choose to think about something, such as when trying to solve a problem or when trying to make the body perform some complex physical task. But what tends to be the case is that our brain seems to run on its own, and our thoughts come at us (seemingly randomly).

Some meditation can be like mental exercise in that we practice either focusing one one thing or avoiding focus on any thing.

At any moment, we have a choice what we will think about. We can choose to think about something outside of our control (such as our past, or the behavior of someone else, or our current bank balance), or we can stop lines of thought and replace them with another focus.

One matter of thought which tends to get too much time/attention is self comparison. There's always someone who is more this or that or who started doing something earlier and was more dedicated. Let them be inspiration, not competition, or it will drive you mad (or make you obsessed).

What was generally have control of is what we choose to think about and what we do right now. We cannot change the past. Perhaps we can learn from it and direct our future in a certain way, but the only actual time is now.

My past includes over a year of actual human time in WoW. It was an escape for me, and looking back it could be viewed as a supreme waste of a year of my life. I would do something else in place of it if I could rewind, but I cannot. So instead I try to learn from it. What I have learned is that there tends to be an underlying reason we "waste time". Perhaps it is an escape from an unpleasant reality, or quite often it is an avoidance of doing something difficult or scary or which was don't know the next step to take. For each of those root causes there can be a solution if we pause and consider (rather than taking the easy path of avoidance/distraction).

If you genuinely want to learn OS internals and be a high performance nerd (not a bad thing, but definitely a choice of direction), then go for it. But try to evaluate periodically why you're doing what you're doing. If the reason is not sound, or it's an excuse (because there's a different underlying reason), you may find yourself without the real motivation to work hard. In other words, you may not have the actual passion necessary to become great. It's ok to be mediocre at something, but it will cause mental conflict if you tell yourself you want to be great at it but don't follow through with the necessary effort.

It's common to not really know what motivates us. Try not to confuse "can" with "should". I could do a lot of things really well if I focused. I have done a number of things well above average with modest effort, so in theory I could have taken any one or few of them and become great. But I didn't really have the passion, so I didn't push. That's ok!

Doing something with passion and love (for yourself or for the results) will make you happier and more importantly satisfied. Chances are, you will also be great at it with seemingly less effort than expected.