When the bad people of Makka continued to be mean to the Prophet (S) and the Muslims, the Prophet (S) decided to leave Makka forever. He told all the Muslims to leave with him and go to Madina, where other Muslims were waiting to welcome them. This move is called the Migration or Hijrat of Prophet Muhammad (S). When the Prophet (S) arrived in Madina, the Muslims there were very happy and welcomed him warmly. One of the first things he did was to build a mosque for the Muslims. He selected a piece of land that belonged to two orphan children. After buying it from them, he asked the Muslims to help him build a simple mosque. All the Muslims helped in clearing the ground and removing the trees and thorny bushes. Afterwards, the work of building the actual mosque began. The Prophet (S) helped as well.
The mosque of Madina was not only a place of prayers. The Muslims came there to learn as well. When the Prophet (S} was present, they heard his words of wisdom. And when he was not present, other faithful companions taught what they had heard from him.
Once the Prophet (S} entered the Mosque before the prayer time. He found two groups in the mosque. One group was busy with its own acts of worship; some were reading the Qur'an while the others were making Du'a. The other group was in a corner busy learning. They were learning how to read and write and discussing the teachings of Islam. Looking at both groups, the Prophet (S} said,
"They are both doing useful things. But I am a teacher. I shall join the group assembled to learn."
And so he sat with the group of students.
We learn from Prophet Muhammad that:
1. The prophet never sat back while people did all the hard work. When the mosque was being built, he worked as hard as everyone else.
2. Learning about Islam is also a part of worshiping Allah.
A hadith from the Prophet (s0
The worst of all men is the one who sells his hereafter (dooms day) for his world (life), & worse than him is the one who sells (bargains) his Hereafter for the world (benefits) of others.
al-Garawi, al-Amthalun Nabawiyyah