The sun was eclipsed during the time of the Messenger of Allah ﷺ, so the Messenger of Allah ﷺ led the people in prayer. In the course of it, he said, "The sun and the moon are two signs among the signs of Allah. They are not eclipsed for the death or the life of anyone. So when you see that, call upon Allah, magnify Him, and give in charity..." and the rest of the hadith.
خسفت الشمس في عهد رسول الله ﷺ، فصلى رسول الله ﷺ بالناس، وفيه… ثم قال: إن الشمس والقمر أيتان من آيات الله لا يخسفان لموت أحد ولا لحياته، فإذا رأيتم ذلك، فادعوا الله، وكبروا، وتصدقوا… الحديث.
Malik reported it in Kusuf (1) from Hisham bin Urwa, from his father, from Ayesha. Bukhari reported it in Kusuf (1044), and Muslim in Kusuf (901), both through the route of Malik, with the same content. The wording given here is that of the Muwatta.