All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu 'alyhi wa sallam, is His slave and Messenger.
It is improper for a believer to be sad. Grieving contradicts belief in Divine decree, which is one of the pillars of faith. Allaah The Almighty, has predetermined every single thing that a person is going to receive or not, the span of their life and whether the person will be prosperous or wretched. Any Muslim who cannot accept the destiny of Allaah The Almighty with satisfaction should rectify his belief, before it is too late.
A Muslim’s prosperity in this worldly life is not restricted to attaining worldly gains. A Muslim must not worry if he misses some worldly achievements because this should be a lesser priority. The first thing that a Muslim should care about is belief in Allaah and his Messengers, may Allaah exalt their mention, and the requisites of this faith, which is the key to happiness in this life and the Hereafter. Having established this belief, a Muslim should obey the orders of Allaah The Almighty and avoid what He has forbidden. What counts is the reward in the Hereafter, which will be for piety.
It is also fundamental to believe in destiny, in that each human will have everything that Allaah The Almighty has predetermined for them to receive and in that Allaah The Almighty, knows what is good for each of His slaves in this worldly life and the Hereafter.
Thus, a Muslim should thank Allaah The Almighty for both prosperity and adversity and should be certain that he is winning anyway. The Prophet, sallallaahu ‘alayhi wa sallam, said that a person would not have perfect faith unless he believes in destiny, either good or bad, and knows that what he receives he would not have missed, and what he misses he would not have received. [At-Tirmithi]
Allaah the Almighty Says (what means):
In conclusion, a believer must thank Allaah The Almighty all the time for all the good things that he has, and that he may, probably, be denied. A believer should thank Allaah The Almighty that he has been exempted from many adversities that may afflict him. A believer should also remember that if he is ungrateful to Allaah The Almighty, he will be a loser in this worldly life and the Hereafter.
Allaah Knows best.