اللَّهُمَّ إِنِّي أَعُوذُ بِكَ مِنْ عَذَابِ الْقَبْرِ، وَمِنْ عَذَابِ النَّارِ، وَمِنْ فِتْنَةِ الْمَحْيَا وَالْمَمَاتِ، وَمِنْ فِتْنَةِ الْمَسِيحِ الدَّجَّالِ
Transliteration: Allahumma ini a`udhu bika min 'adhabi-l-Qabr, wa min 'adhabi-nnar, wa min fitnati-l-mahya wa-lmamat, wa min fitnati-l-masih ad-dajjal
Translation: O Allah! I seek refuge with you from the punishment in the grave and from the punishment in the Hell fire and from the afflictions of life and death, and the afflictions of Al-Masih Ad-Dajjal.
Reference Hadith:
Narrated Abu Huraira:
Allah's Messenger (ﷺ) used to invoke (Allah): "Allahumma ini a`udhu bika min 'adhabi-l-Qabr, wa min 'adhabi-nnar, wa min fitnati-l-mahya wa-lmamat, wa min fitnati-l-masih ad-dajjal. (O Allah! I seek refuge with you from the punishment in the grave and from the punishment in the Hell fire and from the afflictions of life and death, and the afflictions of Al-Masih Ad-Dajjal."
حَدَّثَنَا مُسْلِمُ بْنُ إِبْرَاهِيمَ، حَدَّثَنَا هِشَامٌ، حَدَّثَنَا يَحْيَى، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يَدْعُو " اللَّهُمَّ إِنِّي أَعُوذُ بِكَ مِنْ عَذَابِ الْقَبْرِ، وَمِنْ عَذَابِ النَّارِ، وَمِنْ فِتْنَةِ الْمَحْيَا وَالْمَمَاتِ، وَمِنْ فِتْنَةِ الْمَسِيحِ الدَّجَّالِ ".
Reference: Sahih al-Bukhari 1377
In-book reference: Book 23, Hadith 130
USC-MSA web (English) reference: Vol. 2, Book 23, Hadith 459
https://sunnah.com/bukhari/23/130
In another hadith, Abu Huraira reported:
The Messenger of Allah (ﷺ) said:
When any one of you completes the last tashahhud. he should seek refuge with Allah from four (trials). I.e. from the torment of Hell, from the torment of grave, from the trial of life and death, and from the mischief of Masih at-Dajjal (Antichrist). This hadith has been narrated by al-Auza'i with the same chain of transmitters but with these words:" When any one of you completes the tashahhud" and he made no mention of the words" the last".
وَحَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا الْوَلِيدُ بْنُ مُسْلِمٍ، حَدَّثَنِي الأَوْزَاعِيُّ، حَدَّثَنَا حَسَّانُ بْنُ عَطِيَّةَ، حَدَّثَنِي مُحَمَّدُ بْنُ أَبِي عَائِشَةَ، أَنَّهُ سَمِعَ أَبَا هُرَيْرَةَ، يَقُولُ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِذَا فَرَغَ أَحَدُكُمْ مِنَ التَّشَهُّدِ الآخِرِ فَلْيَتَعَوَّذْ بِاللَّهِ مِنْ أَرْبَعٍ مِنْ عَذَابِ جَهَنَّمَ وَمِنْ عَذَابِ الْقَبْرِ وَمِنْ فِتْنَةِ الْمَحْيَا وَالْمَمَاتِ وَمِنْ شَرِّ الْمَسِيحِ الدَّجَّالِ " . وَحَدَّثَنِيهِ الْحَكَمُ بْنُ مُوسَى، حَدَّثَنَا هِقْلُ بْنُ زِيَادٍ، ح قَالَ وَحَدَّثَنَا عَلِيُّ بْنُ خَشْرَمٍ، أَخْبَرَنَا عِيسَى، - يَعْنِي ابْنَ يُونُسَ - جَمِيعًا عَنِ الأَوْزَاعِيِّ، بِهَذَا الإِسْنَادِ وَقَالَ " إِذَا فَرَغَ أَحَدُكُمْ مِنَ التَّشَهُّدِ " . وَلَمْ يَذْكُرِ " الآخِرَ " .
Reference: Sahih Muslim 588 b
In-book reference: Book 5, Hadith 164
USC-MSA web (English) reference: Book 4, Hadith 1219
https://sunnah.com/muslim/5/164
From the above hadith we learned that this Dua shall be made after completing the last Tashhud. Which according to majority of scholars is after saying Darood-e-Ibrahami and before the Tasleem.
And Allah knows the best!