Genesis Chp 38
While it is not clear why Judah left his brothers after Joseph was sold to the Ishmaelites/Midianites, one commentary indicates that Judah was excommunicated by his brothers, holding him responsible for Joseph's fate. Regardless, Judah finds himself marrying the daughter of Shua, a Canaanite man - something previously not held in high regard.
We've seen God's mercy in Genesis and we have seen God's harsh punishment, and here we see an example of God's harsh punishment.
Judah got a wife for Er, his firstborn, and her name was Tamar. But Er, Judah's firstborn, was wicked in the LORD's sight; so the LORD put him to death. (Gen 38:6-7)
And again:
Then Judah said to Onan, Lie with your brother's wife and fulfill your duty to her as a brother-in-law to produce offspring for your brother. But Onan knew that the offspring would not be his; so whenever he lay with his brother's wife, he spilled his semen on the ground to keep from producing offspring for his brother. What he did was wicked in the LORD's sight; so he put him to death also. (Gen 38:8-10)
While God's mercy is typically reserved for those in God's eyes who are righteous (Noah, Abraham, Lot, etc.) what we need to remember is that this is righteousness in God's eyes. While we may view ourselves as righteous, this is not a judgment we can make. We must continue to seek Him and fear Him. For if we don't, we may falsely assume that our sin - and of course we will sin - is worthy of God's mercy and we may escape harsh punishment. I know I certainly don't want to make this mistake.
My Prayer: Lord, help me draw near to you and both love you and fear you. This is a healthy fear, one that respects your awesome power over everything and everyone. Help me remember that I cannot claim to be righteous; I can only strive to be more like you and pray for your protection and ask for forgiveness from sin. I may be forgiven but this may not help me escape punishment. Help me submit to your will.