Allah's Messenger (ﷺ) said, "The sun and the moon do not eclipse because of someone's death or life but they are two signs amongst the signs of Allah, so pray whenever you see them."
Sahih al-Bukhari Book 16, Hadith 16