It’s very simple – the meaning of life is to serve God. “I created the jinn (spirits) and humankind only that they might worship Me. I seek no livelihood from them, nor do I ask that they should feed Me.” (Quran 51:55-56, trans. M.M. Pickthall)
Serving God takes many forms – prayer, charity, fasting, supplication, pilgrimage, and studying knowledge. You can serve God by doing good to the people and the creatures He created. Actions like cleaning up a park, building a well, writing about God, growing plants, teaching, and many other activities can be acts of service to God.
Even eating and sleeping in moderation can be meritorious as long as we use the energy we get from food and rest to power good deeds.