Right now, I'm a 2nd year student in university doing Computer Science.
In my later years of high school and first few years in university, my parents (especially my dad), have been very much forcing me to study and getting yelling at me over a single bad mark. While it did give me good marks, it made me so stressed out that one day I just decided that I couldn't handle it anymore and resisted. At the time I also thought that if my parents kept on managing me like that, then I'll never really learn how to be truly independent and take control of myself.
After that, they did leave me alone. However, the next semester after that, I failed a course - something which has never happened before. I told myself that it was just a hard course at the time.
This semester, I have lowered my course load from 5 courses to 3. However, I'm always missing or being late to my classes (either it's because of bad time management, having to rely on the bus, or I just don't bother to show up, or I just woke up too late because of my sleep problems) and have a lot of missing quizzes/assignments. I also have never managed to pay attention during lectures and get myself to study as much as I need to and do my assignments on time (and no, I've found that rewarding myself doesn't really work). I just got my 1st midterm mark back and it was a 50%. I fear that this semester may go the same as the last one.
Over the last few semesters, because my dad has stopped forcing me to wake up at 7 AM, my sleep schedule has gone terrible. For example, yesterday I got to bed at 5 AM and get up at 2 PM and if I need to be at school by 11 AM, I get to bed only at around 2 - 3 AM and wake up at 9 - 10 AM and am usually late. Despite my efforts to force myself to go to bed earlier, I've failed. I believe the only thing that can make me go to bed and wake up on time is if either someone else was forcing me to or I had a completely unavoidable and super important reason to which I'd even be willing to sacrifice sleep for (and most days I just don't feel like that). I've tried melatonin and setting an alarm clock far away from my bed and it didn't really help.
I just feel like I really suck and am ashamed of what I've become. Any advice?
Definitely go see a doctor anyway. Whatever the issue is, it is affecting important aspects of your life (completing your degree to securing a career in an area that might interest you long enough to find meaningful work that may or may not be related to your degree). I've found work is usually not as constantly intense as university was for me. If you can find some methods that get you through the rest of university, life will get much easier after.
Joining a club related to my degree helped me meet people in my classes which had so many flow on effects. It helped me stay interested in the degree, helped me notice when other people start their assignments, gave me a heads up how difficult and how long it would take, helped me be social which helped me relax and recharge, helped me ask questions I might have spent sleepless hours on trying to figure out by myself, and the club deadlines made artificial deadlines for assignments.
It might be a big ask, but if you don't know of any clubs reach out to your professors and ask if they know of any projects that help contextualize the material you're learning into the real world. That way it won't just be about abstract concepts. Real applications might make it more relatable, and if you're interested it miiiight help you start and finish those assignments.
Uni is an overwhelming time for many people so don't feel like you're the only one falling behind. See if your uni has a student wellness center. They'll have some resources for you to draw help from.
Another aspect you've brought up that might be affecting how you relate to the world is your upbringing. I wonder if it might be worthwhile ruling out cPTSD (complex PTSD) which can present similarly to ADHD. Some of my problems are due to ADHD but are exacerbated by my cPTSD due to growing up with emotionally neglectful parents. The terminology makes it sound like a big deal but it's just words for concepts that have established methods to help with your specific struggles. There are billions of people on this planet raised in all sorts of environments. Hopefully you can take comfort in the fact that your situation is not that unique and there's likely to be a well trodden path out of this hole. The fundamentals are to be kind to yourself and look after your basic physical and emotional needs. However saying so isn't as easy as recognizing and doing. Building small habits for taking care of your basic human needs like EXERCISE, NUTRITION, SLEEP, and things that RELAX you, will help balance your schedule and feel ready to tackle uni assignments. I truly believe everyone could benefit from some type of therapy. Remember, just because there's a name for things you're experiencing doesn't mean you're fucked up. It just gives you a better roadmap for how to navigate out of it.