Abdullah bin Umar reported,

When the Prophet ﷺ placed the deceased in the grave, and Abu Khalid once said, "when the deceased was placed in his grave," he would sometimes say, "In the name of Allah, by Allah, and upon the religion of the Messenger of Allah," and at other times he would say, "In the name of Allah, by Allah, and upon the way of the Messenger of Allah ﷺ."

Tirmidhi 1046

Sahih

حدثنا أبو سعيد الأشج حدثنا أبو خالد الأحمر حدثنا الحجاج عن نافع

عن ابن عمر

أن النبي ﷺ كان إذا أدخل الميت القبر وقال أبو خالد مرة إذا وضع الميت في لحده قال مرة بسم الله وبالله وعلى ملة رسول الله وقال مرة بسم الله وبالله وعلى سنة رسول الله ﷺ

الترمذي 1046صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Funerals
Chapter
What to say when the deceased is placed in the grave
Numbering
Darussalam 1046
Tirmidhi 1046