From Ada and Güneş's Presentation:
Witchcraft and the supernatural in scene 3 of act 1:
In this scene Shakespeare uses many of the common beliefs of his day about witches:
1.They caused sickness among pigs: “Killing Swine” (line 2, scene 3, act1)
2.They traveled by sea in a sieve (kitchen strainer):”But in a sieve I’ll thither sail”(line 7, scene 3, act1)
3.They were able to take on the form of any animal, but the tail was always missing: “and like a rat without a tail”(line 8, scene 3, act1)
4.They sold winds: “I’ll give thee a wind”(line 10, scene 3, act1)
5.They were protected against their enemies by the cut-off thumb of a ship’s pilot (captain):”Here I have a pilot’s thumb” (line 27, scene 3, act1)
6.They could make a ship take the wrong course but they could neither sink a ship nor kill a man: “Though his bark cannot be lost, yet it shall be tempest-tossed.”(line 23-24, scene 3, act1)
WITCHCRAFT AND THE SUPERNATURAL IN ELIZABETHAN TIMES AND WORKS OF LITERATURE:

During the Elizabethan era people blamed unexplainable events as the work of witches (frequent outbreaks of the deadly Black Death (Bubonic Plague), other terrible diseases, animal deaths, a bad harvest, fires, curdled food…). Usually women who were old, poor, unprotected and widows; were accused of being witches. And as the fear of witches and witchcraft increased in Europe the Catholic Church included in its definition of witchcraft anyone with knowledge of herbs as 'those who used herbs for cures did so only through a pact with the Devil, either explicit or implicit.'
During the reign of Queen Elizabeth I, The 1562 Elizabethan Witchcraft Act was passed. It was an act against Conjurations Enchantments and Witchcrafts.

The attitude of Queen Elizabeth was certainly more lenient than those of her neighbors in France and Spain (Some say this is because of her mother, Anne Boleyn, who had been accused of being a witch).
Coming back to Shakespeare and witchcraft in Shakespeare’s works, there are multiple examples that can be found:
A Midsummer Night’s Dream
The Tempest
Twelfth Night
Hamlet