I asked the Messenger of Allah ﷺ about the plague, and he informed me that it is a punishment Allah sends upon whomever He wills, but that Allah has made it a mercy for the believers. There is no one who, when the plague strikes, remains in his town patiently and seeking reward, knowing that nothing will befall him except what Allah has decreed for him, except that he will receive a reward like that of a martyr.
سألت رسول الله ﷺ عن الطاعون فأخبرني: أنه عذاب يبعثه الله على من يشاء، وأن الله جعله رحمة للمؤمنين، ليس من أحد يقع الطاعون، فيمكث في بلده صابرا محتسبا يعلم أنه لا يصيبه إلا ما كتب الله له إلا كان له مثل أجر شهيد.
Bukhari narrated it in the Hadiths of the Prophets (3474) from Musa bin Ismail, who said, Dawud bin Abu Al-Furat narrated to us, who said, Abdullah bin Burayda narrated to us, from Yahya bin Yamar, from Ayesha, and he related it.