Libraries are filled with books on this topic, of course. Viktor Frankl’s “Man’s Search for Meaning” is perhaps last century’s major work in this genre. There, Frankl says the purpose of life is to find meaning in life, in essence. This is the basis of Logotherapy.
I read a lot of cosmology and such. Beyond surviving and procreation, science doesn’t provide much in the way of answers to this question. Without purpose, you end up with Nihilism, I suppose, and from a societal perspective that position could be deemed destructive. Still, it isn’t difficult for me to conclude that life has no discernible purpose. We’re all just scratching in the dirt, trying to make it another day.