Genesis 38:8

Amplified Bible (AMP)
Then Judah told Onan, “Go in to your brother’s widow, and perform your duty as a brother-in-law [under the levirate marriage custom]; [be her husband and] raise children for [the name of] your brother.”

Read Genesis 38:8 in other translations