It was narrated that Abu Bakrah said:
We were with the Messenger of Allah (ﷺ) when the sun became eclipsed. The Messenger of Allah (ﷺ) went out dragging his garment, until he came to the masjid, and the people gathered around him. He led us in praying two rak'ahs and when (the eclipse) ended he said: 'The sun and the moon are two of the signs of Allah (SWT) by means of which Allah (SWT), the Mighty and Sublime, strikes fear into His slaves. They do not become eclipsed for the death or birth of anyone. If you see that, then pray until Allah (SWT)r relieves you of fear.' That was because his son named Ibrahim had died, and the people suggested to him that (the eclipse) happened because of that.