I heard the Messenger of Allah ﷺ say, "The example of the Mujahid in the path of Allah, and Allah knows best who truly strives in His path, is like that of one who fasts and stands in prayer continuously. Allah has guaranteed for the Mujahid in His path that He will either take his soul and admit him into Paradise, or return him safely with whatever reward or spoils he has gained."
أخبرني عمرو بن عثمان بن سعيد بن كثير بن دينار قال حدثنا أبي عن شعيب عن الزهري قال أخبرني سعيد بن المسيب قال سمعت
سمعت رسول الله ﷺ يقول مثل المجاهد في سبيل الله والله أعلم بمن يجاهد في سبيل الله كمثل الصائم القائم وتوكل الله للمجاهد في سبيله بأن يتوفاه فيدخله الجنة أو يرجعه سالما بما نال من أجر أو غنيمة
Bukhari narrated it in the Book of Jihad, chapter "The Best of People is a Believer Who Strives with His Life and Wealth in the Path of Allah," hadith no. 2787, from the hadith of Shuayb bin Abu Hamza through this same chain, and it is also in Kubra, hadith no. 4332.