All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
First and foremost, we would like to stress the fact that a Muslim always resorts to Allah, takes refuge in Him from Satan and his whispers. We are taught to ward of Satan whenever he tries to approach us. The way is very simple and easy. Just you say few words and Satan takes to his heels. The simple statement is ‘A`odhu Billahi Minash-Shaytan Ar-Rajeem.’(I seek refuge in Allah from the Accursed Satan). So as to get rid of satanic whispers, a Muslim is commanded to stick to reciting the two Protective Qur'anic surahs: surat An-Nas and surat Al-Falaq, as well as Ayat ul-Kursi and surat Al-Baqarah.
"The word "magic" is mentioned in the Qur'an 60 times. Almighty Allah says: "And follow that which the devils falsely related against the kingdom of Solomon. Solomon disbelieved not; but the devils disbelieved, teaching mankind magic and that which was revealed to the two angels in Babel, Harut and Marut. Nor did they (the two angels) teach it to anyone till they had said: We are only a temptation, therefore disbelieve not (in the guidance of Allah). And from these two (angels) people learn that by which they cause division between man and wife; but they injure thereby no one save by Allah's leave. And they learn that which harm them and profit them not. And surely they do know that he who traffic therein will have no (happy) portion in the Hereafter; and surely evil is the price for which they sell their souls, if they but knew." (Al-Baqarah: 102 )?
The verse has the following implications:
1- Magic has been known as a well-established fact regardless of it changing the forms of things.
2- Magic involves things that may be beneficial or harmful, as Allah says: " learn that by which they cause division between man and wife." (Al-Baqarah: 102)
3- Magic cannot have any effect save by the Will of Almighty Allah, as Allah says: " but they injure thereby no one save by Allah's leave." (Al-Baqarah: 102)
4- Adhering to magic renders one a disbeliever, as Allah says: " but the devils disbelieved, teaching mankind magic."
The views of Muslim scholars carry culminate in the following:
1-Attributing the effect of the magic to anything other than Allah renders one a disbeliever.
2-Practicing magic or sorcery for the sake of harming people is totally forbidden. Based on this, it is a form of disbelief to torture people with a magic spell or subject them to the evil of jinn.
As for the most common belief that some people possess extraordinary powers that enable them to do strange things, this is has no basis in Islam. Almighty Allah never grants some of His creatures powers to do evil to people but it happens that some people resort to superstition to do evil to people, and this takes the ruling applied to magic.
The most important point, for a Muslim is to seek Allah's help, strengthen his relationship with Him, try his best to do good and do not let superstitions or imaginations invade his mind so that is does not drive him to the pit of sins. One should have strong belief in Allah and His Absolute Power, as the Prophet says: "If people gather to confer a favor on you, this will never be done unless it has been predestined for you. And, if they conspire together to harm you, they will never harm you unless that has been predestined for you."
Allah Almighty knows best.