The Prophet ﷺ said regarding the verse "Allah keeps firm those who believe with the firm word" [Ibrahim 14:27], "It was revealed concerning the punishment of the grave. He is asked, 'Who is your Lord?' and he answers, 'My Lord is Allah and my Prophet is Muhammad.' That is the meaning of His saying, 'Allah keeps firm those who believe with the firm word in the life of this world and in the Hereafter' [Ibrahim 14:27]."
حدثنا محمد بن بشار حدثنا محمد بن جعفر حدثنا شعبة عن علقمة بن مرثد عن سعد بن عبيدة
عن النبي ﷺ قال {يثبت الله الذين آمنوا بالقول الثابت} قال نزلت في عذاب القبر يقال له من ربك فيقول ربي الله ونبيي محمد فذلك قوله {يثبت الله الذين آمنوا بالقول الثابت في الحياة الدنيا وفي الآخرة}
Sourced from Bukhari, Funerals, Chapter on what has been mentioned regarding the punishment of the grave, no. 4699, 1369, from the hadith of Shubah through this route, and Muslim, Paradise and Its Blessings, Chapter on the deceased being shown his place in Paradise or the Fire... etc., no. 2871/73, from Ibn Bashar through this route.