To engage in magic is totally prohibited, to visit someone who is going to do the magic is actually losing your faith in Allah, is actually coming out of the fold of Islam, is disbelieving in whatever Muhammad sallallahu alayhi wa sallam has brought. So, it is prohibited to cast a spell or to go to someone to cast a spell but these things do exist according to the Quran.
However, we protect ourselves from it by reading ayatul kursi thrice every morning and evening, by reading the last three surahes of the Quran every morning and evening, by seeking the protection in Allah from these evil things three times every morning and evening and perhaps after every prayer.
In surah Ash-Shu’ara where Allah makes mention of the poets towards the end, Allah speaks about the shayateen the devils and these devils who keep coming to people telling them something.
So a person says I have a jinn that comes to me and I know your future. They don’t know the future, they could know the past because with every person there is a Qareen, the Qareen is a devil that tries to deviate the person. He is a little shaitan, the prophet (saw) did not have one because he became a Muslim. That’s the hadith of the Prophet sallallahu alayhi wa sallam. However, it’s very easy for someone to get another jinn to speak to this jinn that is with you and find out every single detail about your life from the beginning right to the point where you are at right now. Because this jinn has a memory that will definitely be stronger than ours.
Shall I inform you upon whom the devils descend? They descend upon every sinful liar. (26:221-222)
If you’re close to Allah it won’t affect you except perhaps that which Allah wills. When you read your al-Mu’awwidhat that the last three surahs of the Quran, the last two are called Al-Mu’awwidhatayn. If you read them Allah will protect you, Allah will grant you that protection. Be convinced; Allah is more powerful.
Another very very interesting factor is when you accuse people falsely of engaging in magic you are worse than them.
However, the stronger you are in your relationship with Allah the less it would affect you. in fact it would not affect you at all.
And rely upon the Exalted in Might, the Merciful, (26:217) Who sees you when you arise (26:218) When you lay your trust in Allah Subhanahu WA Ta’ala he definitely will protect you. He will guide you and he will grant your goodness. – Mufti Menk