The Messenger of Allah ﷺ said to me, "Spend and do not count, lest Allah count against you. Do not hoard, lest Allah withhold from you."
قال لي رسول الله ﷺ: أنفقي ولا تحصي، فيحصي الله عليك، ولا توعي فيوعي الله عليك.
Bukhari narrated it in the Book of Gifts (2591), and Muslim in the Book of Zakat (1029), both through Hisham bin Urwa, from Fatimah bint Munzir, from Asma bint Abu Bakr, who said, and then mentioned it. The wording given is Bukhari's, and Muslim's wording is similar.