Whenever I'm attending a class or even watching an educational video on internet (mainly any educational activity where I'm required to focus), I keep yawning constantly and all the time (I didn't count it before but I think I might yawn once, or maybe even more, every minute), with my eyes getting teary; and I lose my focus constantly and overthinking starts to contain me, I many times not only think about an event, but even keep imagining events and stories within a particular idea; and then I suddenly pay attention to the fact that I missed what I'm there for and I'd been in a different world. I get things together and I try to focus again, but this keeps happening endlessly. Overthinking usually abuses my brain, but it gets worse whenever I'm trying to focus.
It could be many factors: lack of interest, screen time, poor sleep, inconsistent sleep, lack of hydration, too much sugar in your diet (causes crashes), eating before class, not eating enough before class, poor habit formation early in life, lack of physical exercise. There are many, many factors. However, to begin with, you should examine a few things in your lifestyle:
1) What is your diet like? when do you eat? do you eat consistently the same times each day? do you eat a carb heavy diet?
2) Do you get physical activity? Are you hydrated or always drinking diuretics?
3) Examine your sleep schedule. Inconsistent sleep can be worse for you than less sleep.
4) Do you care to be in class? Are you treating your classroom like a job? If not, you should be.
5) Journal your day so you have a record. After two weeks, identify poor patterns in your lifestyle.
6) After you take a deep look into your lifestyle, and the consistency of your lifestyle, consider speaking with a profesional about trying ADHD medication and integrating those medications holistically into your lifestyle.
Nobody here will know why you are the way you are, but those are some key areas of life that you can personally make changes to.
I am not a physician, or an expert on cognitive abilities, but if this happens persistently then I assume you may be simply a person who cannot concentrate or understand oral explanations and presentations. This is a common phenomenon. I think that about 20% of the population if not probably more cannot truly understand oral descriptions of academic subjects (this depends also on the quality of presentation).
This, if my assessment is true, does not mean you should quit academia. It simply means you need to strengthen other abilities and invest more effort and time in listening to oral presentations.
Repeat the video many times until you get it.
Rely more on written material, and read it slowly and repetitively.
Be more active in your learning: instead of listening to others passively, try to actively ask yourself questions and answer them, while going back and forth with the presentations/written-material.
In summary: I cannot asses you personally, but in many cases this is simply a constant property of ones' cognitive abilities. Not something that can change (unless one is willing to take amphetamines etc.). Therefore, you need to find good strategies to overcome this.