Magic can be autocast using Staffs. There are currently two staffs in game - the Staff and the Corrupted Staff, both of which are craft-able from the Crafting Table or obtained from NPC Drops.
With a Staff equipped, you can autocast magic spells if you have enough Elemental Charges for each spell.
Magic Spells use Elemental Charges as Ammo. Elemental Charges can be obtained via two steps.
Talk to Vernon south-west of the bank to get teleported to the Essence Mine.