Shedding more light on the protection against and the immunity from the harm of jinn, we would cite the following:
“Because jinn can see us while we cannot see them, the Prophet (peace and blessings be upon him) taught us many ways to protect ourselves from their harm. They are seeking refuge of Allah from the accursed shaytan, reciting surat Al-Falaq and surat An-Nas, and reciting the words taught by Allah in the Qur’an. Allah Almighty says, “And say: My Lord! I seek refuge in Thee from suggestions of the evil ones. And I seek refuge in Thee, my Lord, lest they be present with me.” (Al-Mu’minun: 97-98)
Saying Bismillah (in the Name of Allah) before entering one’s home, eating or drinking, and having intercourse will keep Satan from entering the house or partaking with a person in his food, drink and sexual activity. Similarly, mentioning the name of Allah before entering the toilet or taking off one’s clothes will prevent the jinn from seeing a person in a state of undress or harming him. The Prophet (peace and blessings of be upon him) says: “To put a barrier that will prevent the jinn from seeing the `awrah of the sons of Adam, let any one of you say ‘Bismillah’ when entering the toilet.” (Reported by at-Tirmidhi)
Strength of faith and religion in general will also prevent jinn from harming a person, so much so that if they were to fight, the one who has faith would win. Ibn Mas`ud (may Allah be pleased with him) says: “A man from among the Companions of Muhammad met a man from among the jinn. They wrestled, and the human knocked down the jinn. The human said to him, ‘You look small and skinny to me, and your forearms look like the front paws of a dog. Do all the jinn look like this, or only you?’ He said, ‘No, by Allah, among them I am strong, but let us wrestle again, and if you defeat me I will teach you something that will do you good.’ The human said, ‘Fine.’ Then he (the human) defeated the jinni. Then, he (the jinni) said, ‘Recite (the verse): “Allah! There is no God save Him, the Alive, the Eternal. Neither slumber nor sleep overtakes Him. Unto Him belongs whatsoever is in the heavens and whatsoever is in the earth. Who is he that intercedes with Him save by His leave? He knows that which is in front of them and that which is behind them, while they encompass nothing of His knowledge save what He will. His throne includes the heavens and the earth, and He is never weary of preserving them. He is the Sublime, the Tremendous.” (Al-Baqarah: 255) The human said, ‘Fine.’ He said, ‘You will never recite this in your house but the shaytan will come out of it like a donkey breaking wind, and he will never come back in until the next morning.’” (Reported by ad-Darimi)
Having stated the above, it becomes clear that no one can cause harm or benefit without Allah’s Will. Also, a Muslim can be immune from jinn by coming closer to Allah, reciting ayat Al-Kursi, surat Al-Ikhlas and Al-Mu`wwidhatayn every morning and evening. This can be also done by seeking Allah’s refuge against jinn and by following the above-mentions tips.