Al-Ilmam bi-Ahadith al-Ahkam 959
عَن عبد الله بن مَسْعُود رَضِيَ اللَّهُ عَنْه قَالَ قَالَ لنا رَسُول الله ﷺ : " يَا معشر الشَّبَاب، من اسْتَطَاعَ مِنْكُم الْبَاءَة فليتزوج (فَإِنَّهُ أَغضّ لِلْبَصَرِ، وَأحْصن لِلْفَرجِ) ، وَمن لم يسْتَطع فَعَلَيهِ بِالصَّوْمِ، فَإِنَّهُ لَهُ وَجَاء ". مُتَّفق عَلَيْهِ، وَاللَّفْظ لمُسلم.
From ʿAbdullah ibn Masʿud, may Allah be pleased with him, who said: The Messenger of Allah ﷺ said to us: "O young men, whoever among you is able to [afford] marriage, let him marry, (for it is more effective in lowering the gaze and guarding the private parts); and whoever is not able, let him fast, for it is a shield for him." Agreed upon, and the wording is Muslim's.