Abu Hurairah reported,

A man came to the Messenger of Allah ﷺ and said, "Messenger of Allah, I am suffering from hardship."The Prophet ﷺ sent word to his wives, but found nothing with them. So the Messenger of Allah ﷺ said, "Is there no man who will host this guest tonight, may Allah have mercy on him?"A man from the Ansar stood up and said, "I will, Messenger of Allah."He went to his family and said to his wife, "This is the guest of the Messenger of Allah ﷺ. Do not hold back anything from him."She replied, "By Allah, I have nothing but the children's food."He said, "When the children want their dinner, put them to sleep, then come and put out the lamp. We will go to bed tonight with empty stomachs."She did so. The next morning, the man went to the Messenger of Allah ﷺ, who said, "Allah عز وجل was amazed," or "smiled at what so-and-so and his wife did last night." Then Allah عز وجل revealed, "And they prefer others above themselves, even though poverty be their lot" [Hashr 59:9].

Bukhari 4889

Sahih

حدثني يعقوب بن إبراهيم بن كثير حدثنا أبو أسامة حدثنا فضيل بن غزوان حدثنا أبو حازم الأشجعي

عن أبي هريرة رضي الله عنه قال

أتى رجل رسول الله ﷺ فقال يا رسول الله أصابني الجهد فأرسل إلى نسائه فلم يجد عندهن شيئا فقال رسول الله ﷺ ألا رجل يضيفه هذه الليلة يرحمه الله فقام رجل من الأنصار فقال أنا يا رسول الله فذهب إلى أهله فقال لامرأته ضيف رسول الله ﷺ لا تدخريه شيئا قالت والله ما عندي إلا قوت الصبية قال فإذا أراد الصبية العشاء فنوميهم وتعالي فأطفئي السراج ونطوي بطوننا الليلة ففعلت ثم غدا الرجل على رسول الله ﷺ فقال لقد عجب الله عز وجل أو ضحك من فلان وفلانة فأنزل الله عز وجل {ويؤثرون على أنفسهم ولو كان بهم خصاصة}

البخاري 4889صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
His saying, "And they give preference over themselves"
Numbering
Darussalam 4889
Bukhari 4889