In Islam, the purpose of life is to worship Allah (God) and to fulfill His commands. Muslims believe that Allah created human beings to worship Him and to live a life of righteousness. The Quran states, "And I did not create the jinn and mankind except to worship Me" (51:56). Worship in Islam encompasses all aspects of life, including prayer, fasting, giving charity, and performing good deeds. Muslims believe that by obeying Allah's commands, they can attain closeness to Him and earn His rewards in the hereafter. The Quran states, "Whoever does righteousness, whether male or female, while he is a believer - We will surely cause him to live a good life, and We will surely give them their reward [in the Hereafter] according to the best of what they used to do" (16:97). Islam also emphasizes the importance of maintaining good relationships with others and treating them with kindness and compassion. The Prophet Muhammad (peace be upon him) said, "The best among you are those who are best to their wives and families, and I am the best among you to my family." (Tirmidhi) Furthermore, Muslims believe that life is a test and that Allah will judge them based on their actions and intentions. The Quran states, "And We will surely test you with something of fear and hunger and a loss of wealth and lives and fruits, but give good tidings to the patient, Who, when disaster strikes them, say, 'Indeed we belong to Allah, and indeed to Him we will return'" (2:155-156). In summary, the purpose of life in Islam is to worship Allah, obey His commands, and live a life of righteousness. Muslims believe that by doing so, they can attain closeness to Allah and earn His rewards in the hereafter. They also believe in the importance of maintaining good relationships with others and treating them with kindness and compassion. Life is seen as a test, and Muslims strive to pass this test by doing good deeds and having good intentions.