Aura Shards has a triggered ability that says 'whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment.' This trigger goes on the stack and targets an artifact or enchantment when it is put on the stack (CR 601.2c, 603.3). The legality of that target is then checked again when the trigger tries to resolve.
Under CR 608.2b, if all targets of a spell or ability are illegal when it tries to resolve, the spell or ability is countered by the rules of the game. It does not resolve, and none of its effects occur. So if the targeted artifact or enchantment has left the battlefield (e.g., it was sacrificed or bounced to hand in response), the trigger simply fizzles with no effect.
A target becomes illegal if it no longer exists, is no longer the correct type, or has gained protection from the relevant characteristics. For Aura Shards' trigger specifically, if the target artifact or enchantment is destroyed, exiled, or otherwise removed before the trigger resolves, the trigger is countered by game rules (CR 608.2b).
Example: Your opponent controls a Darksteel Forge (which makes artifacts indestructible) and a random artifact. You play a creature, triggering Aura Shards, and target that artifact. In response, your opponent sacrifices the artifact (e.g., for some cost). When Aura Shards' trigger tries to resolve, its only target is no longer on the battlefield and is therefore illegal, so the trigger is countered and nothing is destroyed.
Note that if there were multiple targets and only some became illegal, the trigger would still resolve and affect the remaining legal targets (CR 608.2b). But Aura Shards targets only one permanent, so any illegal target means the whole trigger is countered.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.