A creature attacks alone if it's the only creature declared as an attacker during the declare attackers step. For example, Heiko Yamazaki's triggered ability won't trigger if you attack with multiple creatures and all but one of them are removed from combat.

Artwork
Loading artwork…
Heiko Yamazaki, the General
Kamigawa: Neon Dynasty · #146 · EN
Nonfoil—Foil—
Card rules
Trample
Whenever a Samurai or Warrior you control attacks alone, you may cast target artifact card from your graveyard this turn.
3/3
"I prefer to let my sword do the talking."
Uncommon · Illustrated by Magali Villeneuve
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
You must still pay all costs and follow all normal timing rules when casting an artifact from your graveyard this way. Normally, this means you will not be able to cast that card until your post-combat main phase.