The Messenger of Allah ﷺ used to say, "O Allah, I seek refuge in You from the punishment of the grave, I seek refuge in You from the punishment of the Fire, I seek refuge in You from the trials of life and death, and I seek refuge in You from the trial of the false Messiah, the Dajjal."
أخبرنا يحيى بن درست قال حدثنا أبو إسمعيل قال حدثنا يحيى بن أبي كثير أن أبا سلمة حدثه
عن رسول الله ﷺ أنه كان يقول اللهم إني أعوذ بك من عذاب القبر وأعوذ بك من عذاب النار وأعوذ بك من فتنة المحيا والممات وأعوذ بك من فتنة المسيح الدجال
Bukhari transmitted it in "Funerals," the chapter on seeking refuge from the punishment of the grave, hadith no. 1377, and Muslim (see the following hadith no. 5520) from the hadith of Yahya bin Abu Kathir through this chain, and it is found in Al-Kubra, hadith no. 2187.