If a creature's intelligence is reduced to 0 via an Intellect Devourer's Devour Intellect ability, they are stunned until they regain at least 1 point of INT. So how can a stunned creature go about gaining INT? Can a creature that is both stunned and has an INT of 0 attune to an item such as a Headband of Intellect or an Ioun Stone of Intellect?
You cannot attune to those items while stunned
The DMG says about attunement:
Attuning to an item requires a creature to spend a short rest focused on only that item while being in physical contact with it (this can't be the same short rest used to learn the item's properties). This focus can take the form of weapon practice (for a weapon), meditation (for a wondrous item), or some other appropriate activity.
Therefore, you cannot attune to something if you cannot dedicate your focus to it, because attunement is an activity. A stunned creature is unable to do this.
Greater Restoration will fix it
To recover from ability score damage, you need the spell Greater Restoration, which says in its description:
[...] or end one of the following effects on the target:
- Any reduction to one of the target’s ability scores
You can also replicate the spell with Wish, or if you can secure a scroll or Ring of Spell Storing, you can also do that to cast this spell.