Here is the Quranic answer.

As the pendulum of life swings from childhood towards teenage and adulthood, questions about why, what, when start taking control of our minds and hearts. The most compelling question is what is the purpose of life?

We continue to spade through our daily chorus but deep in our hearts and minds, this question keeps surfacing repeatedly.

And We did not create the heavens and earth and that between them in play. 44:38

Allah says in the Qur’an we did not create the heavens and earth and all that is between these in play for amusement or fun. There is some serious purpose behind this as explained in the Qur’an, every human should try to understand this purpose.

And I did not create the jinn and mankind except to worship Me. 51:56

Worship God? Is that the only purpose? But this is because of the limitation of translation. The word used in the Qur’an is Yaabudun, comes from Ibadah. This means to obey, follow the law or commands, out of love and respect for the one you obey and worship Him through rituals.

So first condition is that you follow the laws or commands of Allah our Creator, all your activities of the life should be as per the law of Allah. When you obey Him, obedience has to be accompanied by love, respect and praise.

It should not be the case that you obey Him, out of compulsion only, and you have no faith, love and respect for Him. You should know the God, love Him, respect Him and build relationship with Him. Third portion is to praise Him, worship Him through prescribed rituals.