He had never shown interest in the idols of the Meccans. He knew that it was meaningless to worship the idols.
Our Prophet believed in one God just like the small number of hanifs (believers in the monotheism taught by Prophet Ibrahim). The sadness He felt was due to not knowing the ways to worship Allah.
It had been a few years since He adopted the habit of climbing up Mount Hira, a mountain about 5 miles away from the Ka‘bah, to ponder in the cave. As Ramadan approached, he took supplies with him to Hira in order to spend some time in a cave there, free from gossip and evil.
He reflected on many things including the Meccans who were involved in evil and their salvation. Upon consuming all the food, he would go to the city and help the poor. Then, he would circumambulate the Ka‘bah and then return to Mount Hira again with provisions. Once in a while, his wife Khadijah would accompany him.
Meanwhile, the Prophet started having sadiq (true) dreams. The dreams he had would happen in real life. In the valleys of Mecca, our Prophet heard voices saying, “Hail to you, O Messenger of Allah.” But when he looked around, he only saw trees and rocks, and as he could not see the owner of the voice, he remained in awe.
It could be said that Muhammad was prepared for revelation by Allah. He had spent long periods of time meditating in Hira; had prophetic dreams; heard voices; lived for 40 years without committing any evil; and everyone trusted him as evidenced by his nickname “Amin”.
All of this had to have a meaning, and that meaning was starting to become clear now. At the age of 40, the Prophet was again secluded in Hira during the month of Ramadan in the year 610. It was one of the last 10 days of Ramadan, most probably on the twenty-seventh night, an angel named Jibril appeared to him. Jibril informed him that he was appointed as a prophet by Allah and said, “Read!”
Later Prophet Muhammad narrates the event as follows: That night Jibril approached me and said “Recite!” (Iqra’) “I do not know how to recite,” I said. Upon my answer, the angel held me tight till I could barely stand. Jibril let me loose and said for the second time “Recite!” I replied, “I do not know how to recite.” There the angel held me very tight again and repeated, “Recite!” “What should I recite?” I asked. Jibril, for the third and last time, held me really tight and let me loose. He then revealed the first five verses of Surah al-‘Alaq:
“Recite in the name of your Lord who created created man from a clinging substance. Recite! and your Lord is the most Generous—Who taught by the pen, taught man that which he knew not.”
Our Prophet repeated the verses along with Jibril. He learned the first verses of the Holy Quran from Jibril then repeated and memorized them. He returned home under the heavy influence of the first revelation and the odd incident. Thrilled and afraid, the Prophet ran home trembling. Reaching his house, he went straight to bed telling Khadijah, “Cover me, cover me with a cloth.”