The creature is destroyed if it does not attack because it simply can’t do so legally.

Artwork
Loading artwork…
Nettling Imp
30th Anniversary Edition · #114 · EN
Nonfoil—Foil—
Card rules
1/1
Uncommon · Illustrated by Quinton Hoover
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
PreDH Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
You can use this effect on a creature you know won’t be able to attack. For example, you can use it on a tapped creature.
If the Imp leaves the battlefield before the end of the turn, the creature still is destroyed.
If a turn has multiple combat phases, the ability can only be activated before the beginning of the declare attackers step of the first combat phase in that turn.