It was narrated from Abu Hurayrah (may Allaah be pleased with him) that the Prophet (ﷺ) said:
“Whoever spends the night of Laylat al-Qadr in prayer out of faith and in the hope of reward, his previous sins will be forgiven.
Narrated by al-Bukhaari, 1901; Muslim, 759.
What Prophet Muhammad did in the last ten days of Ramadan
The Messenger of Allah (peace and blessings of Allah be upon him) used to strive hard in worship during the last ten nights of Ramadan as he did not do at other times, praying and reading Quran.
Al-Bukhari and Muslim narrated from `Aishah (may Allah be pleased with her) that when the last ten days of Ramadan began, the Prophet (peace and blessings of Allah be upon him) would stay up at night, wake his family and tie his lower garment tight. According to Ahmad and Muslim: “he would strive hard in worship during the last ten nights of Ramadan as he did not do at other times.”
What to do on Laylat al-Qadr
The Prophet (peace and blessings of Allah be upon him) urged us to spend the night of Laylat al-Qadr in prayer out of faith and in the hope of reward.
Abu Hurayrah (may Allah be pleased with him) narrated that the Prophet (peace and blessings of Allah be upon him) said: “Whoever spends the night of Laylat al-Qadr in prayer out of faith and in the hope of reward, will be forgiven his previous sins.”
This was narrated by the group apart from Ibn Majah. This hadith indicates that it is prescribed to stay up and spend this night in prayer.
Best du`a for Laylat al-Qadr
One of the best du`a’s that can be recited on Laylat al-Qadr is that which the Prophet (peace and blessings of Allah be upon him) taught `Aishah (may Allah be pleased with her). It was narrated by al-Tirmidhi, who classed it as sahih, that `Aishah said: I said: “O Messenger of Allah, If I know which night is Laylat al-Qadr, what should I say?” He said: “Say: Allahumma innaka ‘afuwwun tuhibb al-‘afwa fa’fu ‘anni (O Allah, You are All-Forgiving and You love forgiveness so forgive me).”