Abdullah bin Masud reported,

We went out with the Prophet ﷺ when we were young men with little means. He said, "Young men, you should marry, for it lowers the gaze and guards the private parts. Whoever among you cannot marry should fast, for fasting is a shield for him."

Tirmidhi 1081

Sahih

حدثنا محمود بن غيلان حدثنا أبو أحمد الزبيري حدثنا سفيان عن الأعمش عن عمارة بن عمير عن عبد الرحمن بن يزيد

عن عبد الله بن مسعود قال

خرجنا مع النبي ﷺ ونحن شباب لا نقدر على شيء فقال يا معشر الشباب عليكم بالباءة فإنه أغض للبصر وأحصن للفرج فمن لم يستطع منكم الباءة فعليه بالصوم فإن الصوم له وجاء

الترمذي 1081صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Marriage
Chapter
Virtue of marriage and encouragement toward it
Numbering
Darussalam 1081
Tirmidhi 1081