Sahih Muslim 2121
The Book of Prayer - Eclipses
وَحَدَّثَنِي هَارُونُ بْنُ سَعِيدٍ الأَيْلِيُّ، حَدَّثَنَا ابْنُ وَهْبٍ، أَخْبَرَنِي عَمْرُو بْنُ الْحَارِثِ، أَنَّ عَبْدَ الرَّحْمَنِ بْنَ الْقَاسِمِ، حَدَّثَهُ عَنْ أَبِيهِ الْقَاسِمِ بْنِ مُحَمَّدِ بْنِ أَبِي بَكْرٍ الصِّدِّيقِ، عَنْ عَبْدِ، اللَّهِ بْنِ عُمَرَ أَنَّهُ كَانَ يُخْبِرُ عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ " إِنَّ الشَّمْسَ وَالْقَمَرَ لاَ يَخْسِفَانِ لِمَوْتِ أَحَدٍ وَلاَ لِحَيَاتِهِ وَلَكِنَّهُمَا آيَةٌ مِنْ آيَاتِ اللَّهِ فَإِذَا رَأَيْتُمُوهُمَا فَصَلُّوا " .
Abdullah b. 'Umar reported that the Messenger of Allah (ﷺ) observed:Verily the sun and the moon do not eclipse on account of the death or life of anyone. They are in fact the signs among the signs of Allah. So when you see them, observe prayer
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.