2,253. Wasteful Emission
Hilchos Issurei Biah 21:18
A man is not permitted to wastefully emit semen, so a man is not allowed to enter his wife and finish outside of her. A man may not marry a minor who is not yet able to conceive. Those who intentionally emit wastefully commit a serious transgression and one who does so lives under a ban of excommunication. Regarding such people, Isaiah 1:15 says, “Your hands are filled with blood”; it’s like taking a life.
Hilchos Issurei Biah 21:19
It is prohibited for a man to intentionally induce an erection or to give himself improper thoughts. If an improper thought should happen to enter one’s mind, he should divert himself from decadent things to words of Torah, which are “a beloved hind, a graceful doe” (Proverbs 5:19). Therefore, a man may not sleep on his back facing upward. Rather, one should turn a little on his side in order not to induce an erection.