Awf bin Malik said: In the pre-Islamic period we used to apply spells and we asked: Messenger of Allah! how do you look upon it ? He replied: Submit your spells to me. There is no harm in spells so long as they involve no polytheism.
Related hadith on this topic
Explanation & Benefits
Shaykh Umar Farooq Saeedi
Benefits and Issues:
It is permissible to benefit from such ruqyah (incantations) whose words are clear in meaning and understanding, contain no hint of shirk (associating partners with Allah), and have been proven beneficial through experience.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 3886
Shaykh Maulana Abdul Aziz Alvi
Hadith Commentary: Benefits and Issues: This narration is clear evidence that only those incantations (ruqyah), charms, or spells are prohibited in which shirk (associating partners with Allah) is found, or in cases where the meaning is unknown and there is a risk of shirk.
Source: Tuhfat al-Muslim: Commentary on Sahih Muslim, Page: 5732