عن معاذ - رضي الله عنه - قَالَ: قَالَ رسول الله - صلى الله عليه وسلم: «مَنْ كَانَ آخِرَ كَلامِهِ لاَ إلهَ إِلاَّ اللهُ دَخَلَ الجَنَّةَ». رواه أَبُو داود والحاكم، وقال: «صحيح الإسناد».
It is narrated from Sayyiduna Mu'adh (may Allah be pleased with him) that he said: The Messenger of Allah (peace and blessings be upon him) said: "Whoever's last words are 'There is no god worthy of worship but Allah' will enter Paradise."
(Narrated by Abu Dawud and al-Hakim, and (al-Hakim) said: Its chain is sahih)
Related hadith on this topic