The Prophet ﷺ used to seek refuge from the punishment of the grave and from the trial of the Dajjal, and he said, "You will be tested in your graves."
أخبرنا قتيبة قال حدثنا سفيان عن يحيى عن عمرة
أن النبي ﷺ كان يستعيذ من عذاب القبر ومن فتنة الدجال وقال إنكم تفتنون في قبوركم
Sourcing, sahih. Bayhaqi narrated it in Ithbat Azab Qabr, no. 176, from the hadith of Yahya bin Saeed Ansari, through him, at length, and it is also in al-Kubra, no. 2192. Ibn Khuzayma graded it sahih, no. 851, from the hadith of Yahya. This is a portion of the hadith of Bukhari, no. 1049, 1050.Sufyan is Ibn Uyayna.