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
But If we fail to fulfill our purpose that is to worship Allah alone then we will be considered a failure! We will fail ourselves as this life was made for us for the sake of worshiping Allah, and if we forget this purpose and get caught up with life then we will be the losers in the hereafter, we will lose our battle with the Shaitan and end up in hell. Life is busy, we sometimes do get so busy that we even miss our prayers that is because the Shaitan have done a great job in making this world look really good for us as if we are going to live here forever, we should always take a minute and think about our real life, the life which we will spend forever not this life which will come to an end one day.
Try your best and take a step towards Allah only then you’ll feel peaceful, the peace that we search for is actually found when we get closer to our creator, when we share our problems with him even though he already knows them but he is always ready to listen and help.

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!

But the kings of this world if you ever want to meet them, you’ll spend years in making the appointment and if you finally get a date, you’ll end-up meeting their secretary and you’ll never get to meet or talk with the king in person!
 References: 
Rashid AlJunaibi's post in arabic