Talmudic law prohibits the use of various incantations because of darchei Emori (ways of the Emorites), as we read in our daf yomi (bShab 66b-67b). But there’s a major exception for medical purposes (yesh bo mishum refu’ah). When presumed to be therapeutic, some spells, potions and talismanic remedies are allowed.
Therefore, Talmudic halakhah might approve of Madam Pomfrey casting spells to heal a student injured by playing sports (i.e., Quidditch). Nevertheless, Gilderoy Lockhart’s spell for Harry Potter’s arm would be presumably forbidden by halakhah because neither the spell nor the healer meet the criterion of expertise (mi-mumkheh). (Shab 61a-b) 
In addition, effective spells for other purposes may also be permitted. For instance, spells might be permitted to avoid or defuse dangerous situations, except for incantations that are per se idolatrous or forbidden witchcraft. Please consult a halakhic authority for specifics.
 Examples of permitted incantations:
To relieve a hangover: oil and salt mixture, or diluted clay,. (Shab 66b)
Antipyretic spell: say to an ant: “Your burden upon me, and my burden upon you”
Antipyretic verse: Exodus 3.2 (Shab 67a)
For boils: this incantation includes many unknown words/sounds
For blisters: see 67a For bones stuck in throat: see 67a
For good fortune: say to raven “Croak/shriek and turn your tail to me for Good” (67b)
To slake thirst: “I will drink and leave over, I will drink and leave over”
 On amulets: see comments here.
Disclaimer: This post makes no representations about the current status of spells and other Talmudic remedies under Jewish law (halakhah). I gather that some rishonim allow spells as placebos, while others would rule out (allegedly) supernatural remedies. N.B. most remedies are prohibited (d’rabbanan) on the Sabbath.