Abdullah bin Masud reported,

Abdullah said, "We were with the Prophet ﷺ as young men who had nothing. The Messenger of Allah ﷺ said to us, 'Young men, whoever among you is able to marry should do so, for it lowers the gaze and guards the private parts. Whoever is unable should fast, for fasting will be a shield for him.'"

Bukhari 5066

Sahih

حدثنا عمر بن حفص بن غياث حدثنا أبي حدثنا الأعمش قال حدثني عمارة عن عبد الرحمن بن يزيد قال دخلت مع علقمة والأسود على

عبد الله

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

البخاري 5066صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Marriage
Chapter
He who cannot afford marriage should fast
Numbering
Darussalam 5066
Bukhari 5066