Witchcraft was forbidden under the law of Moses (e.g., Deuteronomy 18:9-11). However it might be helpful to focus on the New Testament.
Galatians 5:19-21 Now the works of the flesh are evident: sexual immorality, impurity, sensuality, (20) idolatry, sorcery, enmity, strife, jealousy, fits of anger, rivalries, dissensions, divisions, (21) envy, drunkenness, orgies, and things like these. I warn you, as I warned you before, that those who do such things will not inherit the kingdom of God.
The word translated “sorcery” in the English Standard Version (ESV) is in some English translations “witchcraft”.
Paul expects us to take very seriously this list of bad behaviour; those who do such things will not inherit the kingdom. The long list includes many sins, not just sorcery (or witchcraft). It might be convenient for me to point the finger at someone who exhibits behaviour that I don’t have a problem with, but conveniently ignore my own sins. For example I might be prone to “fits of anger” but not even find sorcery attractive. Let my condemnation of others be tempered by the realization of my own faults. That does not make sorcery right, but it should keep me humble. The purpose of Paul’s lists of sins is not for me to use as ammunition against others. It is directed at those who are listening to his message. That should include you.