Some people among the Companions of the Prophet ﷺ said to the Prophet ﷺ: “O Messenger of Allah, the people of wealth have taken all the rewards: they pray as we pray, they fast as we fast, and they give charity from their surplus wealth.”
He said: “Has Allah not made for you something by which you can give charity? Indeed, every glorification (saying subḥān Allāh) is a charity, every magnification (saying Allāhu akbar) is a charity, every praise (saying al-ḥamdu lillāh) is a charity, every declaration of His oneness (saying lā ilāha illā Allāh) is a charity, enjoining what is right is a charity, forbidding what is wrong is a charity, and in the sexual act of one of you there is a charity.”
They said: “O Messenger of Allah, does one of us fulfill his desire and still have a reward in it?” He said: “Do you not see that if he were to place it in what is unlawful, he would bear a sin for it? Likewise, if he places it in what is lawful, he will have a reward.”