Narrated Jabir ibn Abdullah: The Messenger of Allah ﷺ was asked about a charm for one who is possessed (nashrah). He replied: It pertains to the work of the devil.
Explanation & Benefits
Shaykh Umar Farooq Saeedi
Benefits and Issues:
To remove jinn or magic, reciting or having recited polytheistic and ignorant incantations is called "nashrah," which is forbidden and impermissible.
For this purpose, Qur’anic verses, transmitted supplications, and prescribed remembrances (adhkar) should be adopted, which is a permissible and desirable act. For example, when magic was done upon the Messenger of Allah (sallallahu alayhi wa sallam), the two chapters of seeking refuge (al-Mu'awwidhatayn: "Say: I seek refuge with the Lord of the daybreak" and "Say: I seek refuge with the Lord of mankind") were revealed.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 3868