The artifact and the enchantment may be the same permanent.

Artwork
Loading artwork…
Naomi, Pillar of Order
Kamigawa: Neon Dynasty · #229 · EN
Nonfoil—Foil—
Card rules
Whenever Naomi enters or attacks, if you control an artifact and an enchantment, create a 2/2 white Samurai creature token with vigilance.
4/4
"Progress comes only when we rise above our petty quarrels."
Uncommon · Illustrated by Joshua Raphael
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pioneer Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If you don't control both an artifact and an enchantment at the moment Naomi, Pillar of Order enters the battlefield or attacks, its ability won't trigger at all. If the ability triggers, it will check again as it tries to resolve. If you don't control both at that time, the ability won't do anything.