Genesis 38:9
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 on the ground, lest that he should give seed to his brother.
ā The Restored Word Bible
Context
7 And Er, Judah's firstborn, was wicked in the sight of the Yahuah; and the Yahuah slew him.
8 And Judah said unto Onan, Go in unto your brother's wife, and marry her, and raise up seed to your brother.
9 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 on the ground, lest that he should give seed to his brother.
10 And the thing which he did displeased the Yahuah: therefore he slew him also.
11 Then said Judah to Tamar his daughter in law, Remain a widow at your father's house, till Shelah my son be grown: for he said, Lest peradventure he die also, as his brethren . And Tamar went and dwelt in her father's house.