“Thou shalt not uncover the nakedness of thy brother’s wife: because it is the nakedness of thy brother.” \
This is adressed to a man with a living brother and his wife. It is saying don’t take your living brother’s wife’s clothes off and look at her naked. Meaning, don’t get lusty with your brother’s wife, your sister in-law by looking at her nude body.
If your brother dies she is free to marry anyone as long as it is not a close blood relative.
In Mosaic Law as followed by Jude, a brother is compelled to marry (go into) his dead brother’s widow if the dead brother is childless. Jude was tricked by his daughter in-law into having sex with her. He was looking for a prostitute and she disguised herself and got pregnant. This has nothing to do with the Mosaic law that compelled Onan to raise up children to his brother’s name in Israel, which law he broke by spilling his seed. He paid for his sin. Jude got away with his.
So what was the daughter in-law doing? She knew Onan was not fulfilling his obligation and she wanted to get pregnant, possibly to keep her dead husband’s lineage in Israel, so she seduced Jude. Sounds crazy to us moderns, but that was how the culture saw things then.