Some men from the Ansar asked the Prophet ﷺ for something and he gave to them. They asked him again and he gave to them again. Then he said, "Whatever wealth I have, I will never withhold from you. But whoever seeks to be self-sufficient, Allah will make him self-sufficient. Whoever seeks to refrain from asking, Allah will grant him restraint. Whoever strives to be patient, Allah will give him patience. No one has been granted anything better or more comprehensive than patience."
حدثنا الأنصاري حدثنا معن حدثنا مالك بن أنس عن الزهري عن عطاء بن يزيد
أن ناسا من الأنصار سألوا النبي ﷺ فأعطاهم ثم سألوه فأعطاهم ثم قال ما يكون عندي من خير فلن أدخره عنكم ومن يستغن يغنه الله ومن يستعفف يعفه الله ومن يتصبر يصبره الله وما أعطي أحد شيئا هو خير وأوسع من الصبر
Agreed upon (by Bukhari and Muslim). Bukhari narrated it in the Book of Zakat, Chapter on Refraining from Asking, hadith no. 1469, and Muslim, hadith no. 1053, from the hadith of Malik, and it is in Muwatta 2/997 (Yahya's recension).There is also a version on this topic from Anas, mentioned previously at no. 1218, and Abu Dawud, hadith no. 1641, and Bayhaqi, 7/25.