Sunnah.com reference : Book 8, Hadith 1English translation : Book 8, Hadith 974Arabic reference : Book 8, Hadith 967
Narrated 'Abdullah bin Mas'ud (RA):
Allah's Messenger (ﷺ) said to us, "O young men, those of you who can support a wife should marry, for it (marriage) controls the gaze and preserves one from immorality. And whoever cannot (marry) should fast, for it is a means of reducing the sexual desire."

[Agreed upon].
عَنْ عَبْدِ اَللَّهِ بْنِ مَسْعُودٍ ‏- رضى الله عنه ‏- قَالَ لَنَا رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-{ يَا مَعْشَرَ اَلشَّبَابِ ! مَنِ اسْتَطَاعَ مِنْكُمُ اَلْبَاءَةَ فَلْيَتَزَوَّجْ , فَإِنَّهُ أَغَضُّ لِلْبَصَرِ , وَأَحْصَنُ لِلْفَرْجِ , وَمَنْ لَمْ يَسْتَطِعْ فَعَلَيْهِ بِالصَّوْمِ ; فَإِنَّهُ لَهُ وِجَاءٌ".‏ }  مُتَّفَقٌ عَلَيْهِ  1‏ .‏‏1 ‏- صحيح .‏ رواه البخاري ( 1905 )‏ ، ومسلم ( 1400 )‏.‏