Sunan an-Nasa'i, Book 22, Hadith 150 (Nasa'i 2244)

It was narrated that 'Abdullah said:

"We went out with the Messenger of Allah and we were young men who could not afford anything. He said: 'O young men, you should get married, for it is more effective in lowering the gaze and protecting one's chastity. Whoever cannot afford it should fast, for it will be a restraint Wija, for him."'