The only thing certain in our life is the uncertainty. We have been through many hapiness as well as sadness through out our times. As one wise says, don’t be too happy when good befalls you, and don’t be too sad when bad befalls you. Life itself is indeed a series of trials and test for each of human being.
This excellent article
Benefits and Adversity: Who Controls them? 7:188articulate the statement above.
Allah SWT says in Quran :
And surely We shall try you with something of fear and hunger, and loss of wealth and lives and crops; but give glad tidings to the patient, Who says, when afflicted with calamity: “To Allah We belong, and to Him is our return”: They are those on whom (descend) Blessings from Allah, and Mercy, and they are the ones that receive guidance. (Al-Baqarah 2:155-157)
In another verse, Allah Almighty says:
He Who created Death and Life, that He may try which of you is best in deed: and He is the Exalted in Might, Oft-Forgiving. (Al-Mulk 67:2)
Whatever misfortune happens to you, is because of the things your hands have wrought, and for many (of them) He grants forgiveness. (Ash-Shura 42:30)
There is one hadith in which the Prophet Muhammad (Salallahu Allaihi Wassalaam) tells us that the people who face the harshest trial are the prophets, then those next to them (in faith and devotion), and then the next. Everyone will be tried according to his level of faith; one who has strong faith will undergo a harsh trial and one who is of weak faith will receive a weak trial. And the affliction will encompass one until he becomes free of sins altogether.
Whatever befalls us, just keep in our mind what Allah Almighty says :
So, verily, with every difficulty, there is relief: (5) Verily with every difficulty there is relief. (Surah Al-Inshirah 94-6)
Hadith on how muslims suppose to react on a trial :
Abu Yahya Suhaib bin Sinan (May Allah be pleased with him) reported: The Messenger of Allah (peace and blessings be upon him) said, “How wonderful is the case of a believer; there is good for him in everything and this applies only to a believer. If prosperity attends him, he expresses gratitude to Allah and that is good for him; and if adversity befalls him, he endures it patiently and that is good for him” Muslim.
Below are Quran verses on Trials and Test to ponder :
Al-Hajj (The Pilgrimage)
22:11 And there is, too, among befalls him, he is satisfied with Him; but if a trial assails him, he turns away utterly,  losing [thereby both] this world and the life to come: [and] this, indeed, is a loss beyond compare! 
47:31 and most certainly We shall try you all, so that We might mark out  those of you who strive hard [in Our cause] and are patient in adversity: for We shall put to a test [the truth of] all your assertions. 
YAA ALLAH YAA HAQQ.