This is a question everyone should have in his/her mind because this is one of those questions which would led you towards setting the goal of your life.
We have been created to test that who amongst us is the good . In surah mulk (Chapter 67 , Verse no 2) , Allah ta'allah says
Allah ta'allah has clearly said that the basic purpose of creatiion of human beings is to tst them that who performs welll and who can't. On the basis of this test, people will be sent in Hell and Heaven.