Socrates, clearly one to see the glass half full, noted that, "If you get a good wife, you will become very happy; if you get a bad one, you will become a philosopher—and that is good for every man." In other words, if you are less happy you will focus more on what constitutes a good life. I think that's somewhat true, in that ebullient moods are great for socializing but bad for thinking about difficult problems. Nothing focuses the mind like adversity of some sort.
I read this about the Bubble Boy David Vetters, who his entire life, right from birth, without human contact because doctors knew his immune system had a rare defect (an earlier brother died shortly after birth). He seems a thoughtful little fellow, and as he aged he could see it was not going to end well. As he reached puberty, he started becoming more depressed and uncontrollable. He once asked his nurse:
Whatever I do depends on what somebody else decides I do. Why school? Why did you make me learn to read? What good will it do? I won't ever be able to do anything anyway. So why? You tell me why
These are very deep questions from a 12-year-old, who was given everything he needed to live, but had no ability to connect or make an impact on anyone or anything. A life needs real achievement to matter. A week before he died, his mother touched his skin for the first time.