As a Muslim my main purpose of life is to be successful in the afterlife,
We have faith in life after death. Muslims believe that the present life is a trial in preparation for the next realm of existence.
All the Prophets of God called their people to worship God and to believe in life after death.
They laid so much emphasis on the belief in life after death that even a slight doubt in it meant denying God and made all other beliefs meaningless. Answer to this question his given by the Holy Book Quran:- And he (i.e. man) presents for Us an example (i.e. attempting to establish the finality of death) and forgets his [own] creation. He says, “Who will give life to bones while they are disintegrated?” Say, “He will give them life who produced them the first time; and He is, of all creation, Knowing.” [It is] He who made for you from the green tree, fire, and then from it you ignite. Is not He who created the heavens and the earth Able to create the likes of them? Yes, [it is so]; and He is the Knowing Creator. (Quran, 36:78-81).