We were with the Prophet (ﷺ) while we were young and had no wealth. So Allah's Messenger (ﷺ) said,
"O young people! Whoever among you can marry, should marry, because it helps him lower his gaze
and guard his modesty (i.e. his private parts from committing illegal sexual intercourse etc.), and
whoever is not able to marry, should fast, as fasting diminishes his sexual power." - Hadith Al Bukhari 5066 (islam)
Book 67, Hadith 4
Vol. 7, Book 62, Hadith 4