The Prophet ﷺ said, "When you hear roosters crowing, it is because they have seen an angel, so ask Allah of His bounty and turn to Him. When you hear donkeys braying, it is because they have seen a devil, so seek refuge with Allah from the evil of what they have seen."
حدثنا أبو عبد الرحمن حدثنا سعيد حدثني جعفر بن ربيعة عن الأعرج
عن النبي ﷺ قال إذا سمعتم أصوات الديكة فإنها رأت ملكا فاسألوا الله وارغبوا إليه وإذا سمعتم نهاق الحمير فإنها رأت شيطانا فاستعيذوا بالله من شر ما رأت
Bukhari, Muslim, Abu Dawud, and Tirmidhi narrated it from Abu Hurairah with this wording, "When you hear the crowing of roosters, ask Allah for His bounty, for they have seen an angel, and when you hear the braying of donkeys, seek refuge with Allah from Satan, for they have seen a devil."