Some men from the Ansar asked the Messenger of Allah ﷺ for something and he gave to them. They asked him again and he gave to them, until what he had was exhausted. He then said, "Whatever good comes into my possession, I will never withhold it from you. But whoever seeks chastity, Allah will keep him chaste. Whoever seeks self-sufficiency, Allah will make him self-sufficient. Whoever seeks patience, Allah will grant him patience. No one has been given a gift better and more comprehensive than patience."
حدثنا عبد الله بن مسلمة عن مالك عن ابن شهاب عن عطاء بن يزيد الليثي
أن ناسا من الأنصار سألوا رسول الله ﷺ فأعطاهم ثم سألوه فأعطاهم حتى إذا نفد ما عنده قال ما يكون عندي من خير فلن أدخره عنكم ومن يستعفف يعفه الله ومن يستغن يغنه الله ومن يتصبر يصبره الله وما أعطى الله أحدا من عطاء أوسع من الصبر
Bukhari recorded it in the book of zakat, chapter on refraining from asking others, hadith no. 1053, through the narration of Malik with this chain. It is also found in Muwatta, chapter on the virtue of restraint, patience, and contentment (Yahya's narration): 2/997.