'A'ishah Radiyallahu 'anha, the wife of Rasulullah Sallallahu 'alaihi wasallam, narrates: I asked Rasulullah Sallallahu 'alaihi wasallam about the plague. So he informed me that it is a punishment (that) Allah sends upon whom He wills; and verily, Allah has made it a source of mercy for the believers. Anyone who remains in his place patiently, at the time of an epidemic of plague, anticipating (reward from Allah), believing that nothing shall befall him but what Allah has written for him, then (by destiny, if he is afflicted by plague there) will be the reward of a martyr for him. (Regardless whether he dies or not because of the plague). (Bukhari: 3474)
Note: Another hadith clarifies the order of the Shari'ah, that if
plague breaks out in a region, whoever happens to be there should not
leave, and who is outside that locality should not enter. Therefore,
this Hadith grants solace for the one who stays patiently in the
locality of the plague. Plague is considered a communicable disease in
which lymph nodes enlarge mainly in the neck, armpit or groins. The
patient generally dies on the second or third day. (Fathul- Bari)
Some scholars have termed every epidemic disease as plague. (Takmilah Fathul Muihim)