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:16:16

And landmarks. And by the stars they are ˹also˺ guided.  

— and landmarks ˹as well˺, by which you might find the roads, ˹landmarks˺ such as mountains, during the day, and by the star, meaning, by the stars, they are guided, to the roads and to the direction of prayer (qibla) by night.
القرآن:١٦:١٦

وَعَلَامَاتٍ ۚ وَبِالنَّجْمِ هُمْ يَهْتَدُونَ  

{وعلامات} تستدلون بها على الطرق كالجبال بالنهار {وبالنجم} بمعنى النجوم {هم يهتدون} إلى الطرق والقبلة بالليل.