One verse

Srimad Bhagavatam 11.17.25

11.17.25

रेतो नावकिरेज्जातु ब्रह्मव्रतधर: स्वयम् । अवकीर्णेऽवगाह्याप्सु यतासुस्‍त्रिपदां जपेत् ॥ २५ ॥

reto nāvakirej jātu brahma-vrata-dharaḥ svayam avakīrṇe ’vagāhyāpsu yatāsus tri-padāṁ japet

retaḥ
semen
na
not
avakiret
should spill out
jātu
ever
brahma-vrata-dharaḥ
one who is maintaining the vow of celibacy, or brahmacarya
svayam
by itself
avakīrṇe
having flowed out
avagāhya
bathing
apsu
in water
yata-asuḥ
controlling the breathing by prāṇāyāma
tri-padām
the Gāyatrī mantra
japet
he should chant

One observing the vow of celibate brahmacārī life should never pass semen. If the semen by chance spills out by itself, the brahmacārī should immediately take bath in water, control his breath by prāṇāyāma and chant the Gāyatrī mantra.