In order to cast magic you first have to create the item which allows it. Usually in groups of 3 casts. I believe you actually start the game with one or are given one early on. Just equip it to your D pad and select and use it during battle. Press B to cast it after you have selected the spell.
If you don't have the item you can create one by finding a camping site. Around these camping sites are usually 3 elemental outlets. If you walk up to them you can absorb their power.
Once you have absorbed one, we will use fire for this example, go into your menu and select Elemancy. Once in this selection you can select and empty location on the right. This will move your cursor to the elemental left side of the window. Here you can mix and match different amounts of elements in order to create the spells that you want to cast. Just select the element you want and press RB once to put some elemental power into the spell. If you chose fire then you will have a window on the bottom left that says Fire X 3 with a 1 under potency. If you want the spells to hit harder then max out the potency. You only need the 1 point for the achievement though.
Once you have determined your potency then just select the bar that says Craft and viola you have a fire spell. Now go equip it to your D pad and you are ready to rock.