Prophet Muhammad (PBUH) carried out the mission of his Lord to His people perfectly. He saved them from ignorance and bad habits and freed their minds from their rigidity and guide them to see the vast horizons of the noble life in this world and the afterword.
The Prophet (PBUH) suffered all kinds of calamities and hardships from the tyrants of Quraysh, the arrogants of the Arabs, and the cruel Jews. They accused him of madness, lying, and magic. They encouraged their children and fools to throw him with earth and stones. They punished those who followed him with the severest kinds of harms and torments. Because of that punishment, Yasir and Sumayyah (Ammar’s parents) were martyred at the beginning of the mission. Then, the first Muslims were obliged to leave their homes and emigrate to Abyssinia.
At that period, the protector and defender of the Prophet (PBUH) was his uncle Abu Talib the faithful of Quraysh, but after his death, the arrogants of Quraysh found the Prophet (PBUH) alone and they deemed him weak. They sent forty men from their villains to surround his house in order to do away with him, but Allah made him escape them under the darkness of night towards Medina after having left his brother Ali bin Abi Talib (A.S) to sleep in his (the Prophet) bed wrapping himself in his (the Prophet) garment. Thus, the Prophet (A.S) was saved by the mercy of Allah the Almighty.
When the Prophet (PBUH) arrived in Medina, he found among its people protection, security, and powerfulness until he took it as his capital. The people of Quraysh were filled with grudge and spite. They prepared armies to fight him from time to time; the battle of Badr, Uhud, al-Ahzab…all under the leadership of Abu Sufyan, the father of Mo’awiyah and the grandfather of Yazeed. However, all their attempts failed and they returned empty-handed but with disgrace. Allah supported His messenger and honored him with great victories until he won the greatest of them; the conquest of Mecca that made people embrace Islam groups by groups and made the arrogant men of Quraysh submit to the rule of Islam and Muslims.
Anyhow, after having carried out the mission of his Lord, the signs of the departure from this world to the better world appeared on the Prophet (PBUH). From the signs of this departure was the following:
First, the Holy Qur’an was reviewed to him twice in that year whereas it was reviewed to him once a year before. [1] Therefore, he felt that his inevitable death was near. [2] He began announcing his coming death to the Muslims. He said to his daughter Fatima (A.S), “Gabriel used to review the Qur’an to me once every year, but this year he reviewed it to me twice. I do not see that for anything except that my death is near.”[3] Second, the following verses were revealed to him, (Surely you shall die and they (too) shall surely die. Then surely on the Day of Resurrection you will contend one with another before your Lord). [4] After the revelation of these verses, Muslims heard him saying, “I wish I knew when that shall be.” Third, the Surah of an-Nasr was revealed to him and he felt that his death was about to come. After that, he often kept silent for a while in the prayer, and when Muslims asked him why, he said, “I am consoled for my life (I have been told that I am about to die).”[5]
source : tebyan