Magic is a fact that is mentioned in the Qur’an, and there is nothing wrong to believe that it has harmful effects if Allah so wills. Nothing can harm a person or benefit him or her except with the will of Almighty Allah.
Shedding more light on this issue, Dr. Salah Sultan, Member of the European Council for Fatwa and Research, states,
Magic certainly harms people by the will of Almighty Allah who confirms this fact in the Qur’an, “‘But they could not thus harm anyone except by Allah’s permission.” (Al-Baqarah 2:102). Therefore, there is nothing wrong in believing that magic does harm people by the will of Almighty Allah.
Magic can not be used for a good cause, unless it is used, as a last resort, to remove some of its effects from a person who is suffering from a magic spell.
However, I advise everyone to use the authentic ruqyah instead, as it is enough and in conformity with the Prophet’s Sunnah.