Marriage is recommended for the one who desires it and can afford it, and the one who cannot afford it should distract himself by fasting Sahih Muslim 1402 c
Translation
Sa'id b. al Musayyib heard Sa'd b. Abi Waqqas (Allah be pleased with him) saying that Uthman b. Maz'un decided to live in celibacy, but Allah's Messenger (ﷺ) forbade him to do so, and if he had permitted him, we would have got ourselves castrated.