It's by Neil deGrasse Tyson but probably still worth thinking about.
There is no meaning to life — just laws of physics and “laws” of natural selection that together cause it. But I suppose you’re welcome to make up something if it’s important to you.
George Carlin had a theory and I can't find any noteworthy flaws in it. [1] Our entire purpose could be to make plastic.
Genetic legacy, societal legacy, and simple vibing.
Most anyone who has had children that have outlived them have satisfied the genetic legacy. Yes, that dilutes very rapidly, but it’s there.
Societal/civilizational legacy is where you are remembered by many after you have died. Thomas Edison and Nikolai Tesla achieved civilizational legacy. So did Cleopatra and Alexander and Genghis Kahn. Rush Limbaugh? Not so much. He failed at leaving a legacy.
The final level is vibing. Finding yourself, understanding yourself, finding peace within yourself, and being one with the universe. Enjoying every day that comes along. Finding satisfaction in everything you do.
https://en.wikipedia.org/wiki/Four_causes https://en.wikipedia.org/wiki/Five_Ways_(Aquinas)
However, We experience "Objective Reality" through our Subjective Senses and infer/deduce more in our "Mind" from experiences/memories/recorded knowledge/etc. using various methodologies/tools.
Based on the above, we build "Worldviews" expressed as "Philosophies" and practiced as "Religions". It is in this domain that your questions make sense and answers can be given. A materialistic/utilitarian philosophy will give you a different answer from an idealistic one.
Note that though objective reality exists (since it is common to others besides oneself) it is through our observations/perceptions/deductions of it through our senses (and extensions of it via technology) that the mind defines/accepts a worldview model. A good way to think about it is as a blank canvas (i.e. nihilism) on which you paint your chosen philosophies.
It is for this reason that ancient Hindu/Buddhist/Greek/etc. philosophies placed "The Mind" at the center of existence and framed "Reality as an Illusion" i.e. your perceived/deduced reality actually exists on a more fundamental substrate. An example often used is that of waves on water where water is the reality and waves are the illusion since they come and go.
Hindu/Buddhist philosophies go further by disambiguating "The Mind" (the field in which emotions/feelings/experiences/thoughts/memories operate) from "Consciousness" (pure awareness which witnesses the above). Based on these theories they define a "universal framework" (viz. goals, stages and duty in life) for all of mankind. Here is a previous comment of mine explaining it - https://news.ycombinator.com/item?id=48325659
Some resources for further study;
1) Philosophy in a Meaningless Life: A System of Nihilism, Consciousness and Reality by James Tartaglia (free ebook) - https://www.bloomsburycollections.com/monograph?docid=b-9781...
2) In Hinduism, the different philosophical schools are called "Darsanas" which literally means a mode of seeing reality i.e. a worldview. There are six major schools and lots of minor ones. A good introduction can be found in An Introduction to Indian Philosophy by Satischandra Chatterjee and Dhirendramohan Datta. Pdf at - https://archive.org/download/IntroductionToIndianPhilosophy/...