Genesis 38:8-10
World English Bible8Judah 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.” 9Onan 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. 10The thing which he did was evil in the LORD’s sight, and he killed him also.
World English Bible (WEB) — Public Domain