What does Genesis 38:18 mean?
Tamar, twice widowed by Judah's two oldest sons (Genesis 38:6–10), has disguised herself as a prostitute with a veiled face. She is attempting to trap Judah into taking care of her since he has abandoned his agreement to allow her to marry his third son. Judah, completely unaware that this is Tamar, is attempting to hire her services (Genesis 38:14–17).She has agreed to the price of a young goat, but only if Judah gives her something of value as collateral until he can send payment. Her choice are items that Judah will certainly want to get back: something uniquely his and clearly irreplaceable. A signet, or "seal," would have been used to stamp his identity on documents. Judah likely carried such an object on a necklace or other cord. Men during this period would also own and carry a staff, likely carved in some unique way.
Tamar's initial plan may have been simply to blackmail Judah: to shame him into caring for her. When he is forced to leave his identification, it's an opportunity to prove what's happened. That she becomes pregnant by this encounter is—from her point of view—the best possible outcome. She now has the children she was promised, as well as leverage to ensure her future.
It's important to note that Scripture doesn't condone Tamar's actions any more than those of Judah. These events are recorded, not endorsed, by their inclusion in this passage.