The thing that I want you to go away with is that -- as long as a magic using character has limited powers -- the reader doesn't care so much about how a character does magic as much as they care what the magic does. (Or, if this is a magical battle, who wins.) An author doesn't need to include details about magic in a story unless it provides setting, forwards the plot, or reveals character. However, just as it is helpful to know some science when writing science fiction, it's useful for the author to be clear about how magic works in a fantasy story set in a magical world.
The other thing that I want to touch on is that well written magic -- much like a well written city, forest river or mountain -- can act in a story like another character. It can be nice or mean, it can be steadfast or fickle, and it can be something that interacts with the character in revealing ways.
When writing believable magic, the author needs to know A) how magic interacts with the physical and social environment, B) the laws of the magical system so magic is used (or not) consistently, and C) how magic interacts with the magic user. This does not necessarily mean the characters have to know these things -- the discovery can be part of a character arc -- but it will be easier to write the magic if the author has these things clear.
MAGIC AND THE ENVIRONMENT
A system of magic always operates in a particular cultural and social setting. For example, think of a car mechanic or a support desk worker or a ham radio operator -- what are some stereotypes around these professions? Now go back fifty years, are the stereotypes different? Now one hundred years. Magic using characters will have cultural roles and expectations based on a specific geographic location and time (see questions).
A system of magic will operate in a physical environment, too. Generally, the author needs to have some idea about where the energy to power spells is coming from, and what magic can not do. Sounding out magic's limits brings up the roles of what I'm going to arbitrarily call fortune, karma, and fate.
- Fortune or luck, which magic can alter, is usually about roulette wheels, coin flips, or being in the right place at the right time. It's small, short-duration circumstances.
- Karma, or cosmic justice, which can be delayed or sped up by magic, relies on the cosmos "remembering" a person's good or bad deeds or luck and rewarding or punishing them. Usually, an "evil" magic user will postpone punishment through a kind of deal with the devil, or a "good" magic user may take on someone else's karmic debt (or seek to magically aid an evil-doer's birds to come home and roost).
- Fate (sometimes called "wyrd") is the limit of a person's life which cannot be changed by magic. It may be a character's fate to kill their father; and there are tons of stories of magic users (and scientists, for that matter) and their hyjinx as they try to go beyond the normal fate of humans (mortality).
Moving from Magic and the Environment, we move onto the Laws of magic.
LAWS OF MAGIC
Most magic in fantasy books is similar to historical magic theory from Western Europe. An author can save some time by using the freebies available from the wonder tales of the West and the North (and my apologies for not being familiar with other systems of magic).
Sir James Frazier and Isaac Bonewits have done most of the footwork formalizing magic. So I'm going to give some examples of various "laws" of magic that many readers will be familiar with.
This is an example of Law of Knowledge, and its corollary, the Law of True Names: Knowledge is power, and the more you have, the more powerful you are. If you know something's name, you have power over it.
This is the Law of Similarity, which states that a result resembles its cause.
This is The Law of Contagion -- the water, once in contact with the ankh, transmits some of its healing power to the patient.
From these three Laws can be deduced a bunch of corollaries.
To improve their minds, the ancient Greeks ate walnuts, because the nut meat looks like a brain.
This is the Doctrine of Signatures at work -- the attributes without mirror the qualities within (usually used in alchemy).
The star, Sirius, rises just before the sun and the Nile floods its banks. The sun is seen within the constellation of Cancer, and the first fruits of the season are ready. Bad stars signal a cata-strophy.
These are examples of "As Above, So Below."
Galahad travels to a distant wasteland. Ruling over the wasteland is the wounded Fisher King. In order to heal the land, Galahad must heal the Fisher King.
You're seeing a form of Heiros Gamos, or sacred wedding between the Land and Monarch -- The quality of a land or state is a reflection of the quality of the ruling monarch, or the quality of the monarch's "spiritual marriage" to the land.
Frazier and Bonewits did their research before 1970. Some additional laws that have come into vogue in "real magic"
In Dion Fortune's Dr. Taverner series, a character is being harassed by an illusion spell of a snarling hell hound -- he knows the hound is in his head, but catches himself referring to the spell as if it were a real dog, giving it the ability to harm him in real life.
These are examples of the Law of Blake's Vision -- if the magician can imagine something, he or she can make it happen.
Denethor, the Stewart of Gondor, gazes into the palantir of Minas Tirith. He sees many things useful, but eventually, he sees only what Sauron, The Dark Lord who has another palantir, wills him to see.
These are examples of the Law of Crowley's Will -- if a magician believes something strongly enough, her or his will or belief will cause it to happen.
In "Oathbreakers," Lackey's magician, Kethry, avenges the death of a friend by channeling her anger (and the anger of her comrades) for use in a revenge spell. "Emotion is power" she thinks.
This is an example of the Law of Gardner's Frenzy -- if a magic user works themselves into a high pitched emotional state while spell casting, the energy of their emotion can be used to power a spell.
Or, you can be like Emma Bull and forget about the Laws of Magic. In her book, "War for the Oaks," a Phooka explains to Eddie, the main character, that she mustn't try to explain away an ointment's powers on her in scientific terms like lumens. "It's magic," he says. Because the Phooka is a supernatural being and Ms. Bull has established his trustworthiness as a character (at least in terms of Seelie Court Magic), the reader accepts his magical explanation.
Or, you can have your magic be a sensitive application of natural science. On an anniversary of the Great Ring's destruction, Frodo is unwell, and is found clutching at a crystal pendant given to him by Galadriel for comfort. Is the crystal "magic" or is Galadriel a clever psychologist?
MAGIC AND THE MAGIC USER
So to review. Magic doesn't exist in a vacuum, it operates in a social, cultural and physical world. It also presumably is enough of a formal system that a writer can figure out some magical laws. All that's left is to talk about the Magic User -- remember the Magic User?
Magic users are in a profession, and like any profession, there are dispositions, skills, talents and workman's comp issues. -- Remember Devon's character? -- If the writer figures out how magic changes the magic users ahead of time, it's more opportunities to have a full character (see questions about magic-users).
WRITING YOUR OWN SPELLS
A magic wielding character will use magic for the following purposes:
Magic to tie or bind, to charm or beguile, to heal, restore, or to protect. To Hex or curse. Magic "tricks" to fool the uneducated rustics. Magic to see the future or the past. Magic spells as weapons.
Most of these are straight-forward, but I want to take a detour on divination. Divination attempts to answer the question, "Will X happen, and if so, when?" Some folks try to get around this by asking what they should know. In most cases, oracles consisting of tokens usually answer in the form 1) a description of the querant, 2) what they hope for, 3) what's in their way, and 4) the probable outcome.
I also want to pause about magical attacks. Historically, a magic user would curse or hex somebody: they would throw a lock down a well and mess up some guy's manhood; they would sprinkle water on the ground and flood the farm next door; or they would pun someone's True Name and mess up their spells. Usually in fantasy books the spell casters are more direct and one reads about magical darts, magical lightning, summoning magical avatars to fight for you, magically freezing one's opponent or sending them to sleep. Just so you know.
A magic spell or ritual typically has the following stages: 1) purification (participants and/or place), 2) a statement of intent, 3) a summoning of magical powers or allies, 4) the performance of a magical act, and 5) the dismissal of powers. The magic user generally uses special words, chants, songs, gestures, or tools to perform a spell. A period of recovery may happen afterward, and it's typical for magical characters to over-reach their magical reserves and suffer afterward.
As another technical aside: Dion Fortune writes that a 20th C magician would call up both the positive and negative forces and then banish the negative ones to be sure that the spell worked. Spells are a simultaneous summoning of what is wanted and a banishment of complementary powers.
MAGIC IN STORY
But, really, all of this is really window dressings for the story. The role of magic in a story is not to provide proof of anyone's laws of magic but to provide opportunites for magic-using characters to use their skills to take risks in order to save something they love. Magic use should reveal character, show setting, or move the plot forward.