If the creature is an illegal target when Sip of Hemlock tries to resolve, it won't resolve and none of its effects will occur. The creature's controller won't lose 2 life. However, if Sip of Hemlock resolves and the creature isn't destroyed (perhaps because it regenerated or had indestructible), the creature's controller will still lose 2 life.

Artwork
Loading artwork…
Sip of Hemlock
Theros · #106 · EN
Nonfoil—Foil—
Card rules
Destroy target creature. Its controller loses 2 life.
Conspirators poisoned the oracle not because her visions were wrong, but because they were right.
Common · Illustrated by Nils Hamm
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Penny Legal
Pioneer Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions