Sahih al-Bukhari 5076
Narrated Abu Huraira:
I said, "O Allah's Apostle! 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 you are going to confront. So (it does not matter whether you) get yourself castrated or not."
وَقَالَ أَصْبَغُ أَخْبَرَنِي ابْنُ وَهْبٍ، عَنْ يُونُسَ بْنِ يَزِيدَ، عَنِ ابْنِ شِهَابٍ، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ قَالَ قُلْتُ يَا رَسُولَ اللَّهِ إِنِّي رَجُلٌ شَابٌّ وَأَنَا أَخَافُ عَلَى نَفْسِي الْعَنَتَ وَلاَ أَجِدُ مَا أَتَزَوَّجُ بِهِ النِّسَاءَ، فَسَكَتَ عَنِّي، ثُمَّ قُلْتُ مِثْلَ ذَلِكَ، فَسَكَتَ عَنِّي ثُمَّ قُلْتُ مِثْلَ ذَلِكَ، فَسَكَتَ عَنِّي ثُمَّ قُلْتُ مِثْلَ ذَلِكَ، فَقَالَ النَّبِيُّ ﷺ " يَا أَبَا هُرَيْرَةَ جَفَّ الْقَلَمُ بِمَا أَنْتَ لاَقٍ، فَاخْتَصِ عَلَى ذَلِكَ أَوْ ذَرْ ".