So...
If a creature must be a spellcaster to attune to an item, the creature qualifies if it can cast at least one spell using its traits or features
- Path of the Wild Heart Barbarians qualify as spellcasters for attunement starting from 3rd level.
- Psi Warrior Fighters qualify as spellcasters for attunement starting at 18th level even though they have magic actions earlier
- Warrior of Shadow and Warrior of the Elements Monks qualify as spellcasters for attunement starting from 3rd level.
- Soulknife Rogues do not qualify as spellcasters for attunement despite having magic actions.
- Aasimar, Elves, Gnomes, and Tieflings all qualify as spellcasters for attunement.
- Backgrounds that include Magic Initiate or taking the Magic Initiate feat through other means qualifies the character as a spellcaster for attunement.
- The Fey-Touched, Ritual Caster, Shadow-Touched, Telekinetic, and Telepathic feats qualify the character as a spellcaster for attunement.