Genesis 38:8-10
Genesis 38:8-10 NASB1995
Then Judah said to Onan, “Go in to your brother’s wife, and perform your duty as a brother-in-law to her, and raise up offspring for your brother.” Onan knew that the offspring would not be his; so when he went in to his brother’s wife, he wasted his seed on the ground in order not to give offspring to his brother. But what he did was displeasing in the sight of the LORD; so He took his life also.