عن ابي ذر أن ناساً من أصحاب النبي ﷺ قالوا للنبي ﷺ يا رسول الله ذهب أهل الدثور بالأجور يصلون كما نصلي ويصومون كما نصوم ويتصدقون بفضول أموالهم قال أوَليس قد جعل الله لكم ما تصدَّقون إن بكل تسبيحة صدقةً وكل تكبيرة صدقة وكل تحميدة صدقة وكل تهليلة صدقة وأمرٌ بالمعروف صدقة ونهيٌ عن المنكر صدقة وفي بُضع أحدكم صدقة قالوا يا رسول الله أيأتي أحدنا شهوته ويكون له فيها أجرٌ قال أرأيتم لو وضعها في حرامٍ أكان عليه فيها وزرٌ فكذلك إذا وضعها في الحلال كان له أجر
صحيح مسلم كتاب الزكاة
Abu Dharr related that some people from among the Companions of the Prophet (SAW) said to the Prophet (SAW): Oh Messenger of Allah, the rich have taken the reward – they pray like we pray, they fast like we fast, and they give charity out of the abundance of their wealth. He said: And has not Allah made for you a way to give charity? Indeed every tasbih [“Subhanallah”] is charity, every takbir [“Allahu akbar”] is charity, every tahmid [“Alhamdu lillah”] is charity, every tahlil [“La ilaha illa Allah”] is charity; prescribing good is charity, prohibiting wrongdoing is charity, and in the genitals [bud’] of any of you there is charity. They said: Oh Messenger of Allah, if any of us takes care of his sex drive, is there is a reward for him in that? He said: Do you see that if he does it with that which is forbidden it would be a sin to him? And in the same way, if he does it with that which is permissible, it is a reward to him.
Sahih Muslim, The book of zakat