Alqama reported,

I was walking with Abdullah at Mina when Uthman met him and stood with him talking. Uthman said to him, "Abu Abdul-Rahman, shall we not marry you to a young woman who might remind you of some of your bygone days?"Abdullah replied, "If you say that, then indeed the Messenger of Allah ﷺ said to us, 'Young men, whoever among you can afford marriage should marry, for it lowers the gaze and guards the private parts. Whoever cannot, let him fast, for it is a shield for him.'"

Muslim 3398

Sahih

حدثنا يحيى بن يحيى التميمي وأبو بكر بن أبي شيبة ومحمد بن العلاء الهمداني جميعا عن أبي معاوية واللفظ ليحيى أخبرنا أبو معاوية عن الأعمش عن إبراهيم

عن علقمة قال

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

مسلم 3398صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Marriage
Chapter
Recommendation of marriage for one whose soul yearns for it and who can afford its expenses, and that one who cannot afford them should occupy himself with fasting
Numbering
Darussalam 3398
Muslim 3398