When does fear of harm caused by the jinn or by people constitute shirk?
Question

                Is it shirk to be afraid of human criminals, or of the jinn, or of entering deserted places? Is it shirk to say that So and so causes harm, meaning that he hits or punches and so on? Is it shirk to say that this thing is harmful to one’s health?
Praise be to Allah.Firstly:
Being afraid of harm caused by evildoers, such as human criminals, comes under the heading of natural, innate fear for which there is a known cause, which is fear of their harm and evil, so one takes action to protect oneself against that by keeping away from them and avoiding them. This kind of fear is not regarded as shirk; rather no one would be blamed for that unless it prompts him to do something haraam.
Ibn ‘Uthaymeen (may Allah have mercy on him) said:
Natural and innate fear is permissible in principle, because Allah, may He be exalted, says of Moosaa (interpretation of the meaning): “So he left it [the city], fearful and anticipating [apprehension]” [al-Qasas 28:21]. And He tells us that Moosaa said (interpretation of the meaning): “My Lord, indeed, I killed from among them someone, and I fear they will kill me” [al-Qasas 28:33]. But if fear prompts a person to neglect an obligatory duty or to do something haraam, then it is haraam. If it prompts him to do something permissible, then it is permissible.
End quote from  Majmoo‘ Fataawa wa Rasaa’il Ibn ‘Uthaymeen (10/648).
Fear of the jinn is subject to further discussion:
·         If it is natural fear, like a person’s fear of anything that could harm him, such as wild animals and snakes, then this is an innate fear, like that referred to above, and the person is not to be blamed for that, so long as it does not prompt him to commit any haraam action. But he should seek to ward off that fear by prescribed means, such as remembering Allah, may He be exalted, calling upon Him and putting his trust in Him.
·         But if it is fear that results from false beliefs, such as if he believes that the jinn can harm or benefit people independently of Allah, then this constitutes shirk. What is required in this case is to correct his belief.
The scholars call this kind of fear khawf as-sirr (lit. fear of the hidden), i.e., fearing something other than Allah, may He be exalted, lest it do him harm of its own volition and power, even if that is indirectly. This constitutes shirk akbar (major shirk), because it is believing that something other than Allah has the power to bring benefit or cause harm. See: Tayseer al-‘Azeez al-Hameed (p. 23).
A similar case is when natural fear of the jinn or anything else that could cause harm prompts a person to devote any kind of worship to them and not to Allah, such as if he calls upon the jinn or seeks refuge with them, and so on. This constitutes shirk akbar (major shirk), associating others with Allah, as is mentioned in the verse in which Allah, may He be exalted, says (interpretation of the meaning):
“And there were men from mankind who sought refuge in men from the jinn, so they [only] increased them in burden”
[al-Jinn 72:6].
Ibn Katheer (may Allah have mercy on him) said:
That is, the jinn used to think that they were superior to humans, because human would seek refuge with them. That is, if they halted in a valley or some desolate place in the wilderness, and the like, as was the custom of the Arabs during their Jaahiliyyah, they would seek refuge with the chief of the jinn in that place, lest he cause them any harm. This is like what one of them would do when he entered the land of his enemy under the protection of a prominent man. When the jinn saw humans seeking refuge with them because they were afraid of them, “they [only] increased them in burden” that is, it increased the humans in fear, terror and alarm, so that they would become even more afraid of the jinn and more eager to seek their protection, as Qataadah said: “they [only] increased them in burden” that is, it increased them in sin, and the power that the jinn had over them would increase thereby.
End quote from  Tafseer Ibn Katheer (8/239).
Thirdly:
If fear of entering deserted places is an innate fear, such as if a person is afraid that there may be scorpions and snakes there, or he is afraid that there may be jinn there who could harm him by Allah’s leave, because the jinn live in deserted places, and the like, he is not to be blamed for that. But if his fear comes under the heading of khawf as-sirr (fearing that something other than Allah could do him harm by its own volition and power), then it constitutes shirk.
Fourthly:
There is nothing wrong with saying in general terms that So and so may cause harm, because he hits people and hurts them, because his harm in this case is connected to some tangible and known cause. This is fine, so long as one still believes that benefit and harm can only happen by Allah’s leave and by His decree, as He, may He be exalted, says (interpretation of the meaning): “But they do not harm anyone through it except by permission of Allah” [al-Baqarah 2:102]. So harm is attributed to people [in this verse], but it happens only by Allah’s leave and by His decree and His will.
At-Tirmidhi (2516) narrated – and classed the report as saheeh – from Ibn ‘Abbaas that the Messenger of Allah (blessings and peace of Allah be upon him) said to him: “Know that if the entire ummah were to come together to benefit you with something, they would not benefit you except with something that Allah had decreed for you, and if they were to come together to harm you with something, they would not harm you except with something that Allah had decreed for you.”
Something similar may be noted with regard to saying “this thing is harmful to one’s health.”
And Allah knows best.