I also had similar experience, my undiagnosed ADHD was unknowingly ruining my life close to a decade. Problem with ADHD is it become late to diagnosed if you are smart, do well in school. My ADHD story goes something like this
I was diagnosed was OCD at 16, even though I had symptoms from 14 or so.
Before 16 I had symptom like difficulty in brushing teeth according to order, difficult to stay still and walk around the house thinking. But these things were not bothering my life that much. I did well on school exams, but starting from 16 with distractibility small task started to take hours, failed exams, anyway I attended to private college here and get through it. After college, I did not apply to any jobs, because I want to do something of my own, I tried different things some failed, but I had constant lingering of project I idea, I worked on it time to time while procrastinating but not close to at least releasing prototype. Like this five years passed away (up to today), I am still not any closer to finish it. As procrastination, I was helping relations, friends browsing social media, watching TV. Also did small freelance dev gigs. Over this time I have read about science of doing work, learning, but none of these helped me to work constantly. I muster my will power for several days and then fall off the wagon, but I keep trying, keep falling. I was feeling envy like OP because my peers were rising the ladder of success/life over these five years, while I was remaining stagnant.
In last March I had all my energy drained out, no any motivation. I lashed out HN[1] and mention that I may have ADHD symptoms. One commenter suggested me to get diagnosed. Then I went to psychiatrist that I was getting treated for OCD, mentioned my demotivation and that I may have ADHD, he was skeptical but prescribed me Atomoxitine. Regardless of difficult side effects, my mind was cleared after a decade, I was able to get things done much, much faster, I was overjoyed. It reminded me what was my mind like before kicking in of distractibility symptoms. I was thinking myself this is what others feeling on day-to-day basis and how much a struggle that I was having. My motivation was also back to good level thanks to new meds. But clear mind did not last more than two days, again distractibility came to previous levels. But motivation was remaining to decent level, so I can get some work done. In next week I am planning to meet new psychiatrist and try other medicines out there since my current one seem to have thin knowledge on ADHD. This video[2] illuminated my understanding of ADHD, I recommend everyone who suspect they have ADHD or have chronic procrastination to check out that video.
The most stressing thing about ADHD is hard to focus, distracted to gushing flow of thoughts. This makes a simple task more time-consuming. For example, reading non-fiction, non-technical book of 150 pages take about a month, which was not the case before 16. Now I know what I have (ADHD) I will battle my self to attain my goals and be successful, despite my disability I would suggest others to do the same. When I 16, 17 my mission was to be remembered. My motivation in my life was my struggles. I had defined purpose as below.
"Inspire and help people with psychiatric and neurological disorders to become fully healthy and happy, Allowing them to do great things in the world."
I am not 100% confident, how to achieve this, but I have some plans. My ADHD and my mom's Parkinson disease have strengthened my purpose. If anyone wants to chat, please do not hesitate to reach out on Reddit (see my profile), I really like to make friends who can understand me.
[1] : https://news.ycombinator.com/item?id=30313215
[2] : https://www.youtube.com/watch?v=_tpB-B8BXk0