Abu Bakra reported,

We were with the Prophet ﷺ when the sun was eclipsed. He rose and headed to the mosque, dragging his cloak behind him in his haste. The people gathered around him, and he led them in two units of prayer just as they normally prayed. When the eclipse had passed, he addressed us, saying, "The sun and the moon are two signs among the signs of Allah, by which He frightens His servants. They do not eclipse for the death of anyone. So when you see either of them eclipsed, pray and supplicate until what afflicts you is removed."

Nasai 1503

Sahih

أخبرنا عمرو بن علي قال حدثنا يزيد وهو ابن زريع قال حدثنا يونس عن الحسن

عن أبي بكرة قال

كنا عند النبي ﷺ فانكسفت الشمس فقام إلى المسجد يجر رداءه من العجلة فقام إليه الناس فصلى ركعتين كما يصلون فلما انجلت خطبنا فقال إن الشمس والقمر آيتان من آيات الله يخوف بهما عباده وإنهما لا ينكسفان لموت أحد فإذا رأيتم كسوف أحدهما فصلوا وادعوا حتى ينكشف ما بكم

النسائي 1503صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Eclipse
Chapter
Commanding supplication during the eclipse
Numbering
Darussalam 1503
Nasai 1503