This is quite the existential question! Of course, there’s really no “right” or “wrong” answer, and there are so many different ideas on what the meaning of life is.
My opinion? There isn’t one. The fact we exist at all is a wildly random event, and the fact we are conscious of it even more so. Life is meaningless, so we create our own meaning. For me, the meaning of life is to strive for happiness (not BE happy, we can’t be happy 100% of the time), bring happiness to those around me, and leave the world better than I came into it. I don’t give a shit about legacy, since I won’t be around to enjoy it. The only legacy I care about is that I made life better for the people I love.
Treat others with kindness, be mindful of the world you live in, and do more of what makes you happy.