Success in this life means nothing if it means failure in the Hereafter.
Would such a statement imply that we should not strive for success in the dunya in terms of money, family, status or property? No. In fact, we should desire the best for ourselves in both the dunya and al-Akhira. We should not place all our attention and energy to one, whether this world or the Hereafter, and neglect the other. As Allah azza wa jall told us in the Qur'an which means:
“But seek, with the wealth which Allah has bestowed on you, the Home of the Hereafter, nor forget your portion in this world: but do good, as Allah has been good to you, and seek not occasions for mischief in the land: for Allah loves not those who do mischief." -Al Qasas 28: 77
Our purpose here is to serve or worship Allah. And worship as Allah and His Messenger described in many ayat and hadiths is any act Allah is pleased with that is done for His sake. And with regards to the good that we do and the fruits we hope to receive from such good, it's paramount that we remember "la hawla wa la quwwata illa billah", that there is no progress, might or power except in Allah. Nothing we do, whether applying for a job, trying to have children, taking medicine, going to school, etc; nothing we do will produce the desired result we expect or hope for EXCEPT that Allah permits it. Our complete tawakul (i.e. reliance on Allah) must be in Allah first and foremost. And no matter what happens we should understand it is ultimately for our own good whether we perceive that good or not, since Allah is Al Hakeem, The All Wise, whereas our wisdom is limited.
"And if anyone puts his trust in Allah, sufficient is Allah for him. For Allah will surely accomplish His purpose. Verily, for all things has Allah appointed a due proportion." -Al Talaq 65:3
As for those who commit acts which Allah has cursed and seem to have success or to have attained a type of happiness, their benefit is only in this life, this transitory life. Useless will it be in their graves and in the Hereafter. Remember, success in this life means NOTHING if it means failure in the next.
Rely solely on Allah. We are living on testing grounds so remember and praise our Rabb always even when at times we're disappointed or disheartened.