When casting a spell, you have to select a legal target for each instance of the word “target” in that spell. So for Punish the Enemy, you need to be able to target both one creature and one player to cast it — although the creature doesn’t have to be controlled by the player you targeted, and vice versa. If your opponent has hexproof, you can target yourself, but you can’t choose to just deal 3 damage to your opponent’s creature.
On the other hand, when the spell tries to resolve, the spell does as much as it can to the targets that are still legal. As long as one target is still legal, the spell will still resolve, even if all the rest are now illegal. As a concrete example, if you target your opponent and your opponent’s Bear Cub, and your opponent gives the Bear Cub protection from red in response, Punish the Enemy will still punish your opponent for 3. Not bad!
Today’s Rules Tip written by Paul Baranay