Genesis 38:9-10
Genesis 38:9-10 TPT
Onan, however, did not want to produce a child that would not be his own rightful heir, so whenever he and Tamar had intercourse, he purposely spilled his semen onto the ground to keep her from getting pregnant and having a child that would belong to his dead brother. But what he did was wicked in YAHWEH’s sight, so he took Onan’s life also.