There are different types of magic in Demon's Souls, but if you are planning to become a magic class, you should make sure you choose one of the starter classes that are intended for it. There are many classes that can use out of the gate magic in Demon's Souls. The best are the magician and the priest. But the Royalty class and Temple Knight can also cast restorative miracles.
Magician is the best, but other classes can also use magic
These characters will start with the appropriate equipment and spells that will allow you to cast and use magic immediately.
For the magician, you will get a jet of flame and a veil of water from the start and you can use them right away in conjunction with the wooden catalyst. As a magic user, you will need an item capable of casting magic in one of your locations on the right. For the priest, you will use the talisman to cast miracles like the healing spell which recovers health.
How to cast magic
You can select the catalyst or the casting element by pressing the right d-pad. You can select the spell you want to cast by pressing the d-pad. If you are able to cast a spell, the spell will be in color, otherwise it will be slightly grayed out.
How to get more spells
You can get more spells in Demon's Souls once you return to the Nexus after defeating Phalanx. Miracle spells and magic spells are available for purchase through NPCs in the Nexus area once you are far enough into the game. Additionally, you must keep in mind that your faith and magic stats must be greater than or equal to 10 to purchase these spells.