Spells are used for various reasons in Wizards Unite, but they will always require Spell Energy. Casting one spell costs 1 Spell Energy. Missing your casting will have you recast your spell for an extra 1 Spell Energy.
Spell Energy can be replenished at Inns (equivalent of PokéStops) which are all over the map. Inns will provide you food, which will in turn add 3 Spell Energy to your bank.
Early recommendation: Based on early reports, casting a spell rapidly is recommended to casting it well.