Everything has a purpose in life if you look around you, everything that has ever been created , every machine, every electronic device everything has a goal and a purpose for which it was created. The creators/inventors of these devices spend a large amount of time to ensure that these devices perform their intended job well.
Like the car for example it’s purpose is to allow us humans to move from place to place in a short time. If it fails to do so then the car is considered useless, another example is a fridge, it was created so that we can put our food in a cold temperature so that it doesn’t get spoiled and become rotten, but if the fridge’s temperature isn’t cold then what happens? everything that we put inside it will get spoiled and the fridge will lose it’s purpose and it will be considered as broken and it will need maintenance so that it could go back and perform it’s intended task.
And if we try to use any device for something that it wasn’t created for, it will fail miserably, e.g. if we try to use the microwave to store food instead of the fridge, the food will get spoiled.
Metaphorically, the Human beings and the Jins were created by Allah for one purpose only and that is to worship him alone as Allah have stated in his Qur’an:
وَمَا خَلَقْتُ الْجِنَّ وَالْإِنسَ إِلَّا لِيَعْبُدُونِ (56) مَا أُرِيدُ مِنْهُم مِّن رِّزْقٍ وَمَا أُرِيدُ أَن يُطْعِمُونِ (57) إِنَّ اللَّهَ هُوَ الرَّزَّاقُ ذُو الْقُوَّةِ الْمَتِينُ (58) سورة الذاريات( 56 ) And I did not create the jinn and mankind except to worship Me.( 57 ) I do not want from them any provision, nor do I want them to feed Me.( 58 ) Indeed, it is Allah who is the [continual] Provider, the firm possessor of strength.Surah Adh-Dhaariyat
It is mind-blowing how ALLAH the king of all kings is ready to listen to your problems without prior appointments, this just shows you how merciful and generous he is!
References: Rashid AlJunaibi's post in arabic