Struck by a plague
Aisha (radi Allahu anha) reported: I asked the Messenger of Allah (sal Allahu alaihi wa sallam) about pestilence (a plague or deadly disease) and he said, “It is a punishment which Allah sends upon whomsoever He wills, but Allah has made it as a mercy to the believers. Anyone who remains in a town which is plagued with pestilence maintaining patience expecting the reward from Allah, and knowing that nothing will befall him other than what Allah has foreordained for him, he would receive a reward of Shaheed.”
To endure patiently in a city where one resides when it is affected by a plague or such other epidemics, and not to flee from it, elevates a Muslim to the level of Shahadah in the way of Allah, as is the case in certain other circumstances, like death by drowning or in maternity, etc.
This order is based on the consideration that the epidemic should not spread to other cities. On the other hand, residents of other cities are ordered to refrain from visiting the affected city. The Hadith clearly shows that it does not go against faith in Allah to take steps necessary for prevention and cure.
Similarly, patience in the event of sickness is a proof of one’s perfect faith in the Will of Allah.
And Allah Knows Best!