The point of going to school is to learn, not to get an A.
The point of living your life is to grow, not to be happy.
In both cases, the latter is usually an indicator of the former, but there are ways to cheat to get the latter without the former. That's where people go wrong.
https://yourmeaninginlife.com/blog/happiness-is-not-the-meaning-of-life
You can always find a reason to complain, and you can always find a reason to be grateful. The former will lead to a miserable life; the latter will lead to a more pleasant life.
https://yourmeaninginlife.com/blog/it-will-always-be-something
There are many misconceptions about how important growth is to your life, from what kinds of growth are possible, whose growth is meaningful, and how growth is meaningful even in the face of endings and death.
https://yourmeaninginlife.com/blog/misconceptions-about-growth-oriented-meaning