I remember as a young teenager watching the Disney adaptation of Moses’ story, titled The Prince of Egypt. In the film storytellers and animators inject a lot of comedy slapstick into the story where god commands Moses to out-magic the Pharaoh’s magicians (Exodus 4:2-6). In other words, fight black magic with black magic! Here god seems to explicitly approve of humans conjuring supernatural powers. There are other stories in the OT that support god’s nod towards the dark arts: In Numbers 5:27 the bible provides a magic potion that can determine whether or not a wife has stepped out on her husband (by causing her serious pain and a divinely-forced abortion). And in Numbers 21:8-9 god gives Moses a magical cure for snake venom. At first glance it seems like god of the OT is a huge fan of magic.
But not so fast. Several passages in the OT are hugely critical of both magic and its practitioners. In Deuteronomy 18:10-12 god commands that magicians are vile and must be driven out of their societies. In Leviticus 19:26-31 god curses witches and wizards. In both Exodus 22:18 and Leviticus 20:27 god commands that witches must be executed. And in 2 Kings 18:3-4 god breaks his tolerance for Moses’ magical hijinks and praises a man who destroys Moses’ magical venom-curing staff (as mentioned above).
Searching for a coherent answer is frustrating. As mentioned even when god gave Moses a magical staff meant to cure people of snake bites, he hates the device so much that he is pleased when it is destroyed. But worry not. Magic is bullshit. It doesn’t exist.