Genesis 38:8 in the King James Version
And Judah said unto Onan, Go in unto thy brother’s wife, and marry her, and raise up seed to thy brother.
Context
7 Er, Judah’s firstborn, was wicked in the LORD’s sight. So the LORD killed him.
8 Judah said to Onan, “Go in to your brother’s wife, and perform the duty of a husband’s brother to her, and raise up offspring for your brother.”
9 Onan knew that the offspring wouldn’t be his; and when he went in to his brother’s wife, he spilled his semen on the ground, lest he should give offspring to his brother.