Abu Qatada reported,

It is reported that the Messenger of Allah ﷺ stood among them and reminded them that striving in the path of Allah and faith in Allah are the most excellent of deeds.A man stood up and asked, "Messenger of Allah, tell me, if I am killed in the path of Allah, will my sins be wiped away?"The Messenger of Allah ﷺ replied, "Yes, if you are killed in the path of Allah while patient, seeking reward, advancing and not retreating."Then the Messenger of Allah ﷺ asked, "What was it you said?"The man repeated, "Tell me, if I am killed in the path of Allah, will my sins be wiped away?"The Messenger of Allah ﷺ said, "Yes, provided you are patient, seeking reward, advancing and not retreating, except for debt, for Jibreel عليه السلام told me so."

Muslim 4880

Sahih

حدثنا قتيبة بن سعيد حدثنا ليث عن سعيد بن أبي سعيد عن عبد الله بن أبي قتادة

عن أبي قتادة أنه سمعه يحدث

عن رسول الله ﷺ أنه قام فيهم فذكر لهم أن الجهاد في سبيل الله والإيمان بالله أفضل الأعمال فقام رجل فقال يا رسول الله أرأيت إن قتلت في سبيل الله تكفر عني خطاياي فقال له رسول الله ﷺ نعم إن قتلت في سبيل الله وأنت صابر محتسب مقبل غير مدبر ثم قال رسول الله ﷺ كيف قلت قال أرأيت إن قتلت في سبيل الله أتكفر عني خطاياي فقال رسول الله ﷺ نعم وأنت صابر محتسب مقبل غير مدبر إلا الدين فإن جبريل عليه السلام قال لي ذلك

مسلم 4880صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Leadership
Chapter
Whoever is killed in the cause of Allah, his sins are expiated except for debt
Numbering
Darussalam 4880
Muslim 4880