Sunan an-Nasa'i, Volume 4, Book 26, Hadith 3209 (DarusSalam)

Narrated 'Alqamah: It was narrated from 'Alqamah, that 'Uthman said to Ibn Mas'ud: "Shall I arrange for you to marry a young girl?" 'Abdullah called 'Alqamah and he told the people that the Prophet said: "Whoever among you can afford it, let him get married, for it is more effective in lowering the gaze and guarding chastity. And whoever cannot afford it, then let him fast, for it will be a restraint for him."

أَخْبَرَنَا بِشْرُ بْنُ خَالِدٍ، قَالَ حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، عَنْ شُعْبَةَ، عَنْ سُلَيْمَانَ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، أَنَّ عُثْمَانَ، قَالَ لاِبْنِ مَسْعُودٍ هَلْ لَكَ فِي فَتَاةٍ أُزَوِّجُكَهَا ‏.‏ فَدَعَا عَبْدُ اللَّهِ عَلْقَمَةَ فَحَدَّثَ أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ ‏ "‏ مَنِ اسْتَطَاعَ الْبَاءَةَ فَلْيَتَزَوَّجْ فَإِنَّهُ أَغَضُّ لِلْبَصَرِ وَأَحْصَنُ لِلْفَرْجِ وَمَنْ لَمْ يَسْتَطِعْ فَلْيَصُمْ فَإِنَّهُ لَهُ وِجَاءٌ ‏" ‏ ‏.‏

sunnah.com