Magic is a supernatural force. It can be channeled into something fantastic like the creation of a dragon out of thin air, or something relatively mundane like making small objects levitate. In order to harness the raw power of magic, an individual requires certain skills and/or attributes (such as training, innate ability via heredity or something else, etc), and even then the amount of magical power any one person can control is usually limited. Manifesting in a variety of ways, the methods used to channel magic are diverse; incantations, artifacts, complex rituals, potions, the list goes on and on.
While magic itself is merely raw power, therefore incapable of possessing any innate morality, it is sometimes seen as purely 'good' or 'evil'. As previously stated, this is not only illogical but impossible, and it falls upon the user to decide whether to use the powers they wield honorably or not (just as it falls upon any individual with power). That being said, there are many individuals within the world of comics that utilize magic, both villains and heroes.
In DC Comics, magical talent has been considered entirely separate from scientific talent, and magic has less to do with supernatural or spiritual matters and more to do with a sixth fundamental force, called at various times the lifeforce or, often, simply magic.
Although DC Comics has changed its continuities a number of time during its long history, in most of its continuities, the ability to wield high levels of magic has a biological and genetic basis rather than being a craft or skill. For this reason, many of those DC heroes who use magic are dependent on magical items such as the Helmet of Fate or the Ruby of Life or Alan Scott's magical Green Lantern ring -- though the same characters that use these items may display some magic abilities without them. Of course, these magical items all have their value due to their rareness and power. Many DC superhumans are born with the ability to wield magic. For example, Amethyst of Gemworld and Nightshade are both descendents of otherworldly noble families with the inherited ability to cast magic. Raven inherited her powers from her demon father Trigan, whereas The Enchantress gained her power from fusing with an ancient mystical spirit.
Mr. Mxyzptlk comes from the 5th Dimension where everyone is born with the ability to wield reality-altering magic, and Klarion the Witch-boy comes from Witch-World, home of an entire species of black magic wielders. Circe is the daughter of Greek divinities, in her case the Titans of myth. One of the most powerful of the magic-wielders in the DC universe, Zatanna, is half homo magi, a race of inherently magical humans (during the Silver Age, it was canon that the ability to wield magic was inherited from the homo magi strain, so the more homo magi DNA an individual had, the greater the magic he or she could wield, whereas those humans who lacked any homo magi DNA could perform only the simplest of magical spells and then only at great cost).
Similarly, other superhumans first must be transformed before their bodies can handle high levels of magic. Bloodwynd and Doctor Mist were both transformed by enchanted forces, a mystical Blood Gem and the Pillar of Life respectively. Doctor Fate had his body transformed by the cosmic lord of order Nabu before he could handle the tremendous power. The White Witch had her body transformed by the teachers of Sorcerer's World. For those who have neither a biological basis for their magic nor powerful magical items, it has been established that magic always has its price. This is why John Constantine, Anton Arcane, and the Cheetah take considerable risks whenever they use magic. Characters like Doctor Fate, Zatanna, and Zatara have used magic to fight crime. Zatanna casts her magic by reciting the desired action backwards (though as has been stated this is a mental exercise for her to focus on the complex magics.)
Magic is also one of Superman's few weaknesses. According to Silver Age continuity, Superman was even more vulnerable to magic than were ordinary humans because Kryptonians have no homo magi DNA to them whereas every Earth human has at least some homo magi DNA.
In Marvel, some characters that employ magic are Doctor Strange, Witchfire, Magik, Ashake, Brother Voodoo, Doctor Doom, Forge, Nico Minoru, (though the Staff of One is the only way she is able to use magic) and Enchantress. In Marvel Comics continuity, for humans the ability to wield magic has little biological basis; instead, it is the result of tremendous study and self-discipline, its training not unlike the training for the highest levels of martial arts. For this reason, it may take years of dedicated study and honing oneself before an aspirant can manage even a minor spell casting. However, there are still characters who are born with a natural talent for magic. Both the Forge and Scarlet Witch are able to use their mutant talents to help them master spell casting, and The Enchantress was born with a talent for spell casting as a consequence of being a Norse goddess.
In the 1940's, newspapers which were concerned with superhero comics cutting into their profits started publishing full sized comic books in the weekly newspaper. For a while a character known as Mr. Mystic was featured in every issue. Mr. Mystic seemingly had the power to do anything and was made invulnerable due to an amulet he wore. Mr. Mystic was able to enlarge himself to a size where he was able to capture planes with his bare hands. He could transform himself or anyone else into different objects. He could even melt a person into a puddle. Mr. Mystic is also able to transport himself into another place by his magic.
There are several powerful magic users in the Malibu Universe including Mantra, Archimage, Yrial and Boneyard. Magic in this universe is divided into elements such as air and fire, but are not limited to those elements. People are born with mystical potential and learn the ways of sorcery, such as Mantra.