Genesis 38:8

38:8 Then Judah said to Onan, “Have sexual relations with your brother’s wife and fulfill the duty of a brother-in-law to her so that you may raise up a descendant for your brother.”

Genesis 38:11

38:11 Then Judah said to his daughter-in-law Tamar, “Live as a widow in your father’s house until Shelah my son grows up.” For he thought, “I don’t want him to die like his brothers.” So Tamar went and lived in her father’s house.