Don't spill it on the ground.
And Judah said unto Onan, Go in unto thy brother's wife, and marry her, and raise up seed to thy brother. And Onan knew that the seed should not be his; and it came to pass, when he went in unto his brother's wife, that he spilled it on the ground. Genesis 38:8-9
Don't get it on you or your partner.
And if any man's seed of copulation go out from him, then he shall wash all his flesh in water, and be unclean until the even. And every garment, and every skin, whereon is the seed of copulation, shall be washed with water, and be unclean until the even. The woman also with whom man shall lie with seed of copulation, they shall both bathe themselves in water, and be unclean until the even. Leviticus 15:16-18