Sahih al-Bukhari 1905
صحيح البخاري#1905SahihNarrated 'Alqama:While I was walking with `Abdullah he said, "We were in the company of the Prophet (ﷺ) and he said, 'He who can afford to marry should marry, because it will help him refrain from looking at other women, and save his private parts from committing illegal sexual relation; and he who cannot afford to marry is advised to fast, as fasting will diminish his sexual power
Scholarly Authentication
We show the most cautious grade (weakest-wins) as the overall label. Individual scholars graded it as follows:
Every narration in Sahih al-Bukhari is accepted as Sahih (authentic) by the established status of the book.
In-book reference: 30:15