Praise be to Allah.
Islam enjoins upholding ties of kinship and forgiving the one who mistreat you, and indeed to respond to his mistreatment with kindness. Allah, may He be exalted, says (interpretation of the meaning):
“And not equal are the good deed and the bad. Repel [evil] by that [deed] which is better; and thereupon the one whom between you and him is enmity [will become] as though he was a devoted friend.
But none is granted it except those who are patient, and none is granted it except one having a great portion [of good]”
As-Sa‘di (may Allah have mercy on him) said:
Allah, may He be exalted, says: “And not equal are the good deed and the bad” that is, doing good deeds and acts of obedience for the sake of Allah is not the same as doing bad deeds and acts of disobedience that incur His wrath and do not please Him. Kindness towards people is not the same as mistreating them, whether in essence, description or requital. “Is the reward for good [anything] but good?” [ar-Rahmân 55:60].
Then Allah enjoins a specific type of kindness, which may have a great impact. It is being kind to the one who mistreats you, as He says:
“Repel [evil] by that [deed] which is better” that is, if anyone mistreats you in word or deed, especially one who has great rights over you, such as relatives, friends and the like, then respond to him with kindness. If he cuts you off, then uphold ties with him. If he wrongs you, then forgive him. If he speaks ill of you, in your absence or in your presence, then do not respond likewise; rather forgive him and speak gently to him. If he forsakes you and does not speak to you, then speak nicely to him and be the first to greet him with salaam. If you respond to mistreatment with kindness, you will achieve much good.
“and thereupon the one whom between you and him is enmity [will become] as though he was a devoted friend” that is, like one of your closest friends.
“But none is granted it” that is, no one is enabled to attain this good characteristic
“except those who are patient” and make themselves put up with that which they dislike, and force themselves to do that which Allah loves. For people are naturally inclined to respond to mistreatment in like manner, and not to forgive it, let alone react with kindness.
But if a person forces himself to be patient and obeys the command of his Lord, and is aware of the immense reward that this attitude brings, and understands that responding in like manner to the one who mistreats him will not benefit him in the slightest and will only make the enmity worse, and that treating him kindly will not detract from his status, for whoever humbles himself for the sake of Allah, Allah will raise him in status, then it will become easy for him and he will do that with pleasure and find delight in it.
“and none is granted it except one having a great portion [of good]” because it is one of the characteristics of the elite among mankind, by means of which a person attains high status in this world and the next; it is one of the greatest of good characteristics.. End quote.
In Saheeh Muslim (2558) it was narrated from Abu Hurayrah that a man said: O Messenger of Allah, I have relatives with whom I try to keep in touch, but they cut me off. I treat them well, but they abuse me. I am patient and kind towards them, but they insult me. He said: “If you are as you say, then it is as if you are putting hot ashes in their mouths. Allah will continue to support you as long as you continue to do that.”
What we have mentioned above is the highest level with regard to the treatment of others. But if someone does not have the strength to do that or to respond to their mistreatment with kindness, and he is afraid that if he mixes with them they will harm him by means of witchcraft or other kinds of harm, as mentioned in the question, then he may cut off ties with them and shun them, for fear of their evil.
Ibn ‘Abd al-Barr (may Allah have mercy on him) said:
The scholars are unanimously agreed that it is not permissible for a Muslim to shun his brother for more than three days, except in the case where he fears that speaking to him and upholding ties with him may undermine his religious commitment, or expose him to harm in his religious or worldly affairs. If that is the case, then he is granted a concession allowing him to avoid him and keep away from him, and perhaps cutting off ties with him and shunning him in a good way will be better than mixing with him in a way that leads to harm.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked:
My wife’s family cause trouble to me and my wife. What is the ruling on shunning them and not visiting them?
He replied: You are allowed not to visit them, if visiting them is causing trouble for you, or for your wife. In that case, you may refuse to visit them, and you may prevent your wife from visiting them too. End quote.
Fataawa Noor ‘ala ad-Darb (12/474-475)
And Allah knows best.