(8) باب مَا يُكْرَهُ مِنَ التَّبَتُّلِ وَالْخِصَاءِ
Narrated Abu Huraira:
I said, "O Allah's Messenger (ﷺ)! I am a young man and I am afraid that I may commit illegal sexual intercourse and I cannot afford to marry." He kept silent, and then repeated my question once again, but he kept silent. I said the same (for the third time) and he remained silent. Then repeated my question (for the fourth time), and only then the Prophet said, "O Abu Huraira! The pen has dried after writing what youare going to confront. So (it does not matter whether you) get yourself castrated or not."
Reference: Sahih al-Bukhari 5076
In-book reference: Book 67, Hadith 14
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 7, Book 62, Hadith 13