It was narrated from 'Abdullah bin 'Amr that the Prophet ﷺ said: "Allah accepts the repentance of His slave so long as the death rattle has not yet reached his throat".
The Prophet Muhammad ﷺ also taught us that when asking for forgiveness from Allah, one should not only regret their actions but also make a firm intention never to repeat them again in the future. This hadith reminds us of how merciful and forgiving Allah is towards His slaves and encourages us to take advantage of His mercy by seeking His forgiveness whenever necessary.