Any attack that does not specifically require a particular action may be used.
The rules for Actions in Combat state:
When you take your action on your turn, you can take one of the actions presented here, an action you gained from your class or a special feature, or an action that you improvise.
The Stone description states that you use an action to make an attack roll against AC 24. This is an "action gained from a special feature" described in the Actions in Combat section. Therefore we conclude that any attack will suffice, provided that attack does not require a different particular action. This means that the presence of an active Ioun Stone in combat gives all creatures present access to the special action of removing the stone from its owner's head.
Ergo, any attack made using a spell will not work, as using a spell requires the Cast a Spell action, not the special action gained from the presence of an active Ioun Stone.
This is the best we can do in general, use cases of certain spells must be examined individually. For example, we could use our bonus action to cast shadow blade, then make the attack with the shadow blade using our action.
Ranged attacks are unclear and require the DM to make a ruling.
The language of the Ioun Stone is unclear:
another creature must use an action to grasp or net the stone to separate it from you, either by making a successful attack roll against AC 24 or a successful DC 24 Dexterity (Acrobatics) check.
Can I shoot the Ioun Stone off of your head with my crossbow? It is unclear if this would count as "netting the stone to separate it from you". "Grasp or net" seems to imply that you are gaining possession of the stone, which seems inconsistent with a ranged attack. This interaction will require a ruling from the DM. I have permitted ranged attacks to target Ioun Stones in the past, ruling that the stone is jettisoned onto the ground in a random direction from its owner on a successful hit that did not destroy the stone outright.
Acrobatics from range is right out.
This is still a DM ruling, as the written parameters are unclear, but it seems obvious that the acrobatics check does not apply outside of your normal reach.
From 20 feet away, the Ioun Stone was so impressed with my backflip that it just fell to the ground, depriving its owner of its power.