Handling wasted time I'm 27 years old, currently doing a Master's course in eletrical engineering in Germany.
I have a problem with my mindset having to do with my past. When I was 16 I was strongly addicted and smoked weed every day. After finishing school I got involved with new friends and more drugs while doing an apprenticeship (training for a practical job in Germany). I struggled but ended somehow managed to complete it.
After that (at age 19) I started undergrad studies and things went downhill. Obviously partying and using drugs while studying is not the best combination. After 2 years I realized that something has to change. I changed my field of study and left all of my friends.
It took me about 2 years to regain focus and start learning.
I somehow started being highly motivated and performed very well. I also started an industry job while studying and did well there, too.
But now it hurts to see how much time I wasted. My colleagues are almost 5 years younger than me. I know that I can be proud of myself for achieving what I did, but I can't let go of these regrets.
My questions are:

How can I deal with these feelings?

Also, how should I discuss the wasted time in a job interview?
How can I deal with these feelings?

It certainly helps to put things into perspective. In the large scheme of things, 5 years are not much. In these times, it's not uncommon that people make radical career shifts in their 30s or 40s, starting from zero at a much later point in time than you do now.

Also, how should I discuss the wasted time in a job interview?

It's unlikely that this will be addressed, since employees generally care more about &quot;what you bring to the company&quot; than about your personal biography. If they do address it, you're in a comfortable position because you changed your study field. You can explain that you reoriented yourself towards the new study field because it better matched your interests, preferences, and strengths (and recognizing that took some time for significant consideration).
Don't mention the partying and avoid a &quot;wasted time&quot; mindset. A better mindset is that this earlier study period was valuable because it allowed you to recognize what you're good at.