Abu Mas'ud al-Ansari reported Allah's Messenger ﷺ as saying: Verily the sun and the moon are the two signs among the signs of Allah by which He frightens his servants and they do not eclipse on account of the death of any one of the people. So when you see anything about them, observe prayer, supplicate Allah till it is cleared from you.
The hadith also teaches us about humility in front of God's power and greatness. We must remember that no matter how powerful or knowledgeable we may be in this world, there will always be things beyond our control such as eclipses which only God can control. Therefore, it is important for us to humble ourselves before Him in order for Him to answer our prayers more quickly.