In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Allaah tested Prophet Ayyoub [peace be upon him] and Prophet Ya’qoob [peace be upon him] when he lost his two sons [i.e. Yusuf and Binyameen- peace be upon them] as well as the effects of the severe grief in his heart. Allaah said: [ وَتَوَلَّىٰ عَنۡہُمۡ وَقَالَ يَـٰٓأَسَفَىٰ عَلَىٰ يُوسُفَ وَٱبۡيَضَّتۡ عَيۡنَاهُ مِنَ ٱلۡحُزۡنِ فَهُوَ كَظِيمٌ۬ – And he turned away from them and said: “Alas, my grief for Yusuf (Joseph)!” And he lost his sight because of the sorrow that he was suppressing]. [Surah Yusuf.Verse 84]
Allaah tested Muhammad [peace and blessings of Allaah be upon him] during the early years of his (Prophethood) and obligated on him to call his people to abandon the Shirk and the misguidance they were nurtured upon by their forefathers. He made that clear to them in private and public- day and night. He approached them in their hangouts, gatherings and towns, and carried on doing so for nearly 13 years whilst they inflicted severe harm on him, even though prior to this he lived for 40 years or more without being harmed. He was from a noble, honoured and respected tribe – a noble, honoured and respected household. He grew up with noble manners due to which he was honoured and respected by the people, but despite this he was very modest.
The one with these qualities received severe harm and faced extreme hardship. This harm intensified with mockery- this one spat in his face and that one attempted to place his feet on his neck whilst he prostrated to his Lord (in prayer), and another person placed the intestines of a camel on his back whilst he prostrated, and such and such person grabbed the collar of his garment to strangle him. His uncle (Abu Lahab) followed him wherever he went and warned against him, saying, “He (i.e. Muhammad) is a liar”. “He is insane”. The foolish were incited against him and they pelted him with stones until blood flowed from his two feet. Others boycotted him and his close relatives – for a long time – in order that they die out of hunger. Some people tortured his followers with various types of torture, and amongst them were those who were forced to lie down on the sand during the hottest time of the day and were denied water, and one of them was burnt with fire until the only thing that extinguished the fire was the fat on his back. A woman amongst them was tortured, but when they realised that she would not renounce Islaam, they stabbed her in her private area and murdered her.
All this torture was not due to anything else other than the fact that the Messenger was calling them in order to remove them from the darkness of Shirk and enter them into the light of Islaam- to remove them from corruption and enter them into upright conduct; distance them from the anger of Allaah and guide them to the means of attaining Allaah’s Pleasure; remove them from the path of eternal punishment and guide them towards the path of permanent bliss; however they did not pay attention to this despite the fact that its proofs were very clear; rather the only thing that concerned them was that he was calling them to other than what they desired.
Also, Allaah tested the Prophet [peace and blessings of Allaah be upon him] through the death of his parents when he was very young, then the death of his grandfather, the death of his uncle who used to protect him and the death of his wife who used to console him. The calamities did not cease, even though he is the leader of the children of Aadam and the most beloved person to Allaah [The Mighty and Majestic].
Therefore, ponder on all of this in order to know based on true knowledge that the mutual rivalry – in which we engage and greedily exert ourselves to acquire the enjoyment of the worldly life – is nothing compared to attaining Allaah’s Pleasure and eternal bliss in paradise. As for the misery and hardships of the worldly life which we flee from, they are nothing compared to Allaah’s displeasure, His anger and eternal punishment in the hell fire. Anas Bin Maalik [may Allaah be pleased with him] reported that Allaah’s Messenger [peace and blessings of Allaah be upon him] said, “A person amongst the inhabitants of Hell – who lived the most enjoyable life amongst the people of the world – would be dipped in fire only once on the Day of Resurrection and then it would be said to him, ‘O son of Adam! Did you find any comfort, did you happen to get any material blessing?’ He would say, ‘By Allah! No, my Lord’. Then a person amongst the people of the world would be brought – who lived the most miserable life (in the world) – from amongst the inhabitants Paradise and he would be dipped once in Paradise, and it would be said to him, ‘O son of Adam! Did you face any hardship? Or had any distress fallen to your lot?’ He would say, ‘By Allah! No, O my Lord, never did I face any hardship or experience any distress'”. [Saheeh Muslim. 2807]
[Source: An Excerpt from ‘Aathaar Ash-Shaikh Al-Allaamah Abdur Rahmaan Bin Yahyah Al-Mu’allimee. Vol 11. pages 311-313. slightly paraphrased]