Anas bin Malik reported,

The Messenger of Allah ﷺ went out to the trench and found the Emigrants and the Helpers digging on a cold morning, for they had no servants to do the work for them. When he saw the exhaustion and hunger they were enduring, he said, "O Allah, the true life is the life of the Hereafter, so forgive the Helpers and the Emigrants."They replied to him, "We are the ones who pledged allegiance to Muhammad to strive in jihad as long as we live."

Bukhari 4099

Sahih

حدثنا عبد الله بن محمد حدثنا معاوية بن عمرو حدثنا أبو إسحاق عن حميد سمعت

أنسا رضي الله عنه يقول

خرج رسول الله ﷺ إلى الخندق فإذا المهاجرون والأنصار يحفرون في غداة باردة فلم يكن لهم عبيد يعملون ذلك لهم فلما رأى ما بهم من النصب والجوع قال اللهم إن العيش عيش الآخره فاغفر للأنصار والمهاجره فقالوا مجيبين له نحن الذين بايعوا محمدا على الجهاد ما بقينا أبدا

البخاري 4099صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expeditions
Chapter
Battle of Khandaq, which is Ahzab
Numbering
Darussalam 4099
Bukhari 4099