In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Imaam Ibnul Qayyim [rahimahullaah] said:
When Allaah and His Messenger [sallal-laahu-alayhi-wasallam] are on one side [i.e. after they have passed their judgement on an affair], then beware of being on the other side, for indeed that would lead you to be in opposition. Therefore, be on the side of Allaah and His Messenger even if all the people are on the other side, for indeed that has the most praiseworthy and virtuous end result and there is nothing more beneficial to the servant -in the worldly affairs and affairs related to the afterlife- than that.
The majority of the creation are on the other side, especially when they have a strong desire [for something] and an [intense] fear [of something]; so in such a case you might not find anyone on the side of Allaah and His Messenger; rather they would consider it [i.e. to be on the side of Allaah and his Messenger] as deficiency in intelligence and a bad choice and might even consider it to be something tantamount to insanity. This is something inherited from the enemies of the Messengers, for indeed they attributed insanity to them [i.e. Messengers] because they [i.e. the Messengers] were on one side, whilst the people were on another side.
[As for the one] who is determined to be on the side of Allaah and His Messenger, then indeed he is in need of firmly grounded knowledge based on that which the Messenger [sallal-laahu-alayhi-wasallam] came with [i.e. the religion of guidance and righteous action], so that it becomes a source of certainty for him, whilst harbouring no doubt about it. He [also needs] great patience whilst facing the enmity of the one who shows him enmity and the blame of the one who blames him. And this cannot be accomplished except by way of a strong fervent desire for Allaah [i.e. he gives precedence to seeking Allaah’s pleasure etc.] and the home of the afterlife [i.e. reward in the afterlife]. The home of the afterlife becomes more beloved to him than the worldly life; he gives precedence to the afterlife over the worldly life, and Allaah and His Messenger [sallal-laahu-alayhi-wasallam] become more beloved to him than everything else.
There is nothing more difficult for a person than the beginning of this affair, for indeed his [weak human] soul, his desires, [weak] nature, the shaytaan that accompanies him and his kinsfolk invite him to the fleeting pleasures of this worldly life; so they fight him when he opposes them. But if he exercises patience and remains steadfast, Allaah will aid him, so that the difficulty [he faces] changes into a state of ease and the pain [he experiences] changes into a state of pleasure; for indeed the Lord [Allaah] is Most Ready to appreciate good deeds and to recompense. Allaah will make him taste the pleasure [that is experienced] by the one who is on the side of Allaah and His Messenger. Allaah will show him kindness, so that this happiness and contentedness increases. Those who fought him will either be in awe of him or be in a state of peace with him- either a supporter of his or will leave him [alone]. His allies will become strong and his enemies will be weak.
Therefore, do not consider being in opposition to the people and on the side of Allaah and His Messenger as [something] difficult, even if you are alone; for Allaah will protect and aid you. You are under His watchful eyes [free is Allaah from all likeness, deficiencies, weaknesses, shortcomings, co-equals etc] and guardianship, but He only tests your certainty and patience [i.e. when you oppose the people and take His side and that of His Messenger]. The greatest help-after Allaah’s Help- for you in this affair is that you are free from covetousness and anxiety, because when you are freed from them it becomes easy to be on the side of Allaah and His Messenger. Therefore, always be on the side of Allaah and His Messenger so that when covetousness and anxiety approaches, you neither become covetous nor does your soul whisper to you [i.e. make you unsettled about the affair, rather than being certain and steadfast].
And if you say, “Through what can I be freed from covetousness and anxiety [regarding this affair]? Say? “Through Tawheed [Pure Islamic Monotheism], reliance and trust in Allaah, and to know the fact that no Hasanaat [i.e. good deeds and its rewards etc] can come to you except from Allaah, and no Sayyi’aat [i.e. evil deeds, sins and its consequences etc] can be removed except by Allaah. All affairs are in Allaah’s [absolute] control and no one else [has anything or can do anything without the will of Allaah]. [Source: Al-Fawaa’id pages 175-176. paraphrased]