In Islam, Means always have the same rulings of Ends
Therefore, if the mean is forbidden, the end will also be forbidden, no matter how this end is a noble or good one.
This why Witchcraft is restrictly forbidden regardless of how good is the cause.
So, one can't practice Witchcraft to help others for example, because the mean still remains a forbidden one.
There is no doubt that Witchcraft is a serious major sin and one of the abominations that we should avoid.
It causes a person to fall into Major Disbelief for the great damage and injury that afflicts others.
This is why we find many texts in the Quran and Tradition of the Prophet (peace be upon him) warning from Witchcraft.
Let's see together:
In Quran
Allah (may He be Exalted) says:
(10:81)
And when they had thrown, Moses said, "What you have brought is [only] magic. Indeed, Allah will expose its worthlessness. Indeed, Allah does not amend the work of corrupters.
And
(2:102)
And they followed [instead] what the devils had recited during the reign of Solomon. It was not Solomon who disbelieved, but the devils disbelieved, teaching people magic and that which was revealed to the two angels at Babylon, Harut and Marut. But the two angels do not teach anyone unless they say, "We are a trial, so do not disbelieve [by practicing magic]." And [yet] they learn from them that by which they cause separation between a man and his wife. But they do not harm anyone through it except by permission of Allah . And the people learn what harms them and does not benefit them. But the Children of Israel certainly knew that whoever purchased the magic would not have in the Hereafter any share. And wretched is that for which they sold themselves, if they only knew.
Also, According to a Authentic Tradition narrated from the Messenger of Allah (peace and blessings of Allah be upon him),
He said, “Avoid the seven things which will lead to doom.” He was asked, “What are they, O Messenger of Allah?” He said: “Associating anything with Allah; witchcraft; killing a soul whom Allah has forbidden us to kill unlawfully; consuming usury; consuming the orphan’s wealth; fleeing the battlefield; and slandering chaste but innocent believing women.”
To add;
One of the knowledgeable Scholars in Islam called Al-Nawawy (may God Almighty have mercy on him) said:
"practicing Witchcraft is forbidden, and it is one of the major sins unanimously, and the Prophet, may God’s prayers and peace be upon him, counted it among the seven fetalities".
Based on that, it is obligatory for a Muslim not to practice Witchcraft or follow Witches, rather, one should avoid Satan, and his steps and seek refuge and help only from Allah.
May Allah bless you and us with understanding of Islam and steadfastness in our religion, and may He keep us safe from that which goes against it, for He is the Most Generous, Most Kind.