Buckminster Fuller gave a lecture once, and then took questions.
Someone asked, "What is the meaning of life?" Everyone laughed. (It was a "science" crowd, sort of a bunch of Prof. Sheldon Cooper wannabes) But he answered:
"To be a mirror to help shine light into dark places"
Aristotle would say happiness is the answer. Be happy in the sense of contented. You're content when you have a life well lived. It takes practice. You have to choose the ethical decision which may mean personal sacrifices. But then you have no regrets. Do the right thing, even at personal cost. Watch the movie Battle of the Bulge and see how American POWs acted when imprisoned by the Japanese. Or compare John McCain with John Dramesi, 2 POWs in North Vietnam. McCain sold out, gave the North Vietnamese military intelligence to help them kill American troops. McCain did radio propaganda broadcast, over 30, calling American troops war criminals, to demoralize other POWs and American soldiers. McCain never tried to escape and received perks and privileges in return for his collaboration with the enemy. Dramesi never gave more than name, rank and serial number and tried to escape, twice. He got caught and was severely beaten.
McCain went on to capitalize on his "war hero" image. Dramesi lived in relative obscurity. Or take Hugh Thompson, the unknown "hero of My Lai" who saved half the village, confronting his superior officer Lt. Calley, risking his life and career. He died in relative obscurity, ostracized by his fellow officers, who wouldn't eat with him at the mess hall. People left dead animals on his porch. Rep. Rivers called for his prosecution as a traitor.
You do what's the right thing, and you suffer, but you can live with yourself, unlike others.
Even if you're an atheist like Hugh Everett or the fictional Sheldon Cooper, you may believe in the parallel universe interpretation of quantum physics, where we continue living in an alternative universe even after we biologically die on this planet. Same with University of Arizona Professor Gary Schwartz, author of The Afterlife Experiments. Schwartz believes we continue to live as energy, after biological death. How you live this life will determine how you live in the next life or alternative universe. Similar to Buddhist reincarnation.