The Messenger of Allah ﷺ used to teach us this supplication just as he would teach us a surah from the Quran, "O Allah, I seek refuge in You from the punishment of Hell, I seek refuge in You from the punishment of the grave, I seek refuge in You from the trial of the False Messiah Dajjal, and I seek refuge in You from the trials of life and death."
حدثنا إبراهيم بن المنذر الحزامي حدثنا بكر بن سليم حدثني حميد الخراط عن كريب مولى ابن عباس
كان رسول الله ﷺ يعلمنا هذا الدعاء كما يعلمنا السورة من القرآن اللهم إني أعوذ بك من عذاب جهنم وأعوذ بك من عذاب القبر وأعوذ بك من فتنة المسيح الدجال وأعوذ بك من فتنة المحيا والممات
Its isnad is hasan. Bukhari narrated it in Adab al-Mufrad, no. 694, from Ibrahim bin Munzir through this route, and Busiri graded it hasan. The hadith has many corroborating witnesses.