Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:67:5

And We have certainly beautified the nearest heaven with stars and have made ˹from˺ them what is thrown at the devils and have prepared for them the punishment of the Blaze.  

And verily We have adorned the lowest heaven, the one closest to the earth, with lamps, with stars, and made them missiles against the devils, should they ˹attempt to˺ listen by stealth, in which case a meteor of fire detaches itself from the star, just like a brand is taken from a fire, and either kills that jinn or deprives him of his senses: it is not that the star itself is displaced from its position; and We have prepared for them the chastisement of the Blaze, the ignited Fire.
القرآن:٦٧:٥

وَلَقَدْ زَيَّنَّا السَّمَاءَ الدُّنْيَا بِمَصَابِيحَ وَجَعَلْنَاهَا رُجُومًا لِلشَّيَاطِينِ ۖ وَأَعْتَدْنَا لَهُمْ عَذَابَ السَّعِيرِ  

{ولقد زيَّنا السماء الدنيا} القربى إلى الأرض {بمصابيح} بنجوم {وجعلناها رجوما} مراجم {للشياطين} إذا استرقوا السمع بأن ينفصل شهاب عن الكوكب كالقبس يؤخذ من النار فيقتل الجني أو يخبله لا أن الكوكب يزول عن مكانه {وأعتدنا لهم عذاب السعير} النار الموقدة.