إِنَّهُ يَرَاكُمْ هُوَ وَقَبِيلُهُ مِنْ حَيْثُ لاَ تَرَوْنَهُمْ
It means: "Verily he and his followers see you from a place that you can not see them." (Surat Al A'raf: 27).
وَأَنَّهُ كَانَ رِجَالٌ مِّنَ الْإِنسِ يَعُوذُونَ بِرِجَالٍ مِّنَ الْجِنِّ فَزَادُوهُمْ رَهَقًا
Muqaddimah
As for Prophet Sulayman 'alaihis salam, Allah conquered the jinn to submit beneath his kingdom. Allah hinders them, so they can not deviate or do damage. Allah says:
وَمِنَ الشَّيَاطِينِ مَن يَغُوصُونَ لَهُ وَيَعْمَلُونَ عَمَلًا دُونَ ذَٰلِكَ ۖ وَكُنَّا لَهُمْ حَافِظِينَ
"We have subdued (also to Solomon) a group of shaykhs who are diving (into the sea) for him and doing work other than that, and We are guarding them." (Surat al-Anbiya: 82)
Al-Hafidz Ibn Kathir said:
"The meaning of the verse, Allah protects Solomon so as not to be exposed to evil acts of evil, on the contrary, all demons are under his grasp and power. No single demon can approach it. He harassed them, if he wanted, he could release the devil or vice versa, he could prison the devil. Allah says,
وَآخَرِينَ مُقَرَّنِينَ فِي الأصْفَادِ
(Tafsir Ibn Kathir, 5: 359)
Jin's status in the Qur'an?
1. Genie is created from fire and created before man
And verily We have created man (Adam) from dry clay (derived) from a form of black mud. And We have created the preceding genie from a very hot fire. (Al-Hijr: 26-27).
خُلِقَتِ الْمَلاَئِكَةُ مِنْ نُورٍ، وَخُلِقَ الْجَانُّ مِنْ مَارِجٍ مِنْ نَارٍ، وَخُلِقَ آدَمُ مِمَّا وُصِفَ لَكُمْ. رواه مسلم
Angels have been created from light, the jinn are created from the flame, and Adam was created from the ground (which has been explained to you). (Muslim)
2. The djinn are creatures that multiply and inherit
And when We said unto the angels: "Prostrate thou to Adam, and thou shalt fall down except the devil. He is of the genie, so he disobeys his Lord. Should you take him and his descendants as a leader other than Me, and they are your enemies? Wickedly the devil is a substitute (from God) for the zhalim. (Al-Kahf: 50).
3. Jin can see man while man can not see jinn
O son of Adam, do not you ever be deceived by Shaytan as he has taken out your father's two fathers from heaven, she stripped off both of her clothes to show them both her aurat. Indeed he and his followers see you and a place you can not see them. We have made the shaytings of the rulers of the unbelievers. (Al-A'raf: 27).
4. That among the Jinn there is a believer and some are infidels, because they are given the rhythm (the will) and the right to choose like humans.
And indeed among us there is a dutiful jinn and there is also a genie that deviates from the truth. Whoever is obedient, then they really have chosen a straight path. As for the jinn who deviate from the truth, then they become the wood of fire for Hell. (Al-Jin (72): 14-15).
Dealing with jinn is one of the doors of destruction and has the potential to bring great harm to the culprit. This potential danger can be understood from the hadith Qudsi in which the Messenger of Allah (PBUH) delivered the message of Allah swt:
وَإِنِّي خَلَقْتُ عِبَادِي حُنَفَاءَ كُلَّهُمْ، وَإِنَّهُمْ أَتَتْهُمْ الشَّيَاطِينُ فَاجْتَالَتْهُمْ عَنْ دِينِهِمْ، وَحَرَّمَتْ عَلَيْهِمْ مَا أَحْلَلْتُ لَهُمْ، وَأَمَرَتْهُمْ أَنْ يُشْرِكُوا بِي مَا لَمْ أُنْزِلْ بِهِ سُلْطَانًا. رواه مسلم
Legal Working with Jin?
Jin according to the Qur'an has similarities with humans in some respects that is (a) equally intelligent; And (b) equally mukallaf or obligation to practice Islamic sharia (ومَا خَلَقْتُ الجِنَّ والإنسَ إلاَّ لِيَعْبُدُونِ), (أَلَمْ يَأْتِكُمْ رُسُلٌ مِّنكُمْ يَقُصُّونَ عَلَيْكُمْ آيَاتِي ويُنذِرُونَكُمْ لِقَاءَ يَوْمِكُمْ هَذَا قَالُوا شَهِدْنَا عَلَى أَنفُسِنَا); (c) having human-like activities such as eating, drinking, waking, sleeping, getting married, (أَفَتَتَّخِذُونَهُ وذُرِّيَّتَهُ أَوْلِيَاءَ مِن دُونِي وهُمْ لَكُمْ عَدُوٌّ)
There is no Quranic verse or hadith of the Prophet which prohibits or allows unequivocally friendship with the jinn. That is why scholars differ on the law. That allow to be guided by the view of Ibn Taimiyah above. But it should be noted that the genie is a spirited creature that can manifest itself in humans in various forms such as snakes, dogs, and other animals or in human form. Therefore, it is better not to get too close to the jin because if we can control it, it does not guarantee we can survive the trickery.