Usama b. Zaid reported that Allah's Messenger (ﷺ) had said:
Plague is the sign of a calamity with which Allah, the Exalted and Glorious, affects people from His servants. So when you hear about it, don't enter there (where it has broken out), and when it has broken out in a land and you are there, then don't run away from it.
وعن عائشة رضي الله عنها أنها سألت رسول الله صلى الله عليه وسلم عن الطاعون، فأخبرها أنه كان عذاباً يبعثه الله تعالى على من يشاء، فجعله الله تعالى رحمة للمؤمنين، فليس من عبد يقع في الطاعون فيمكث في بلده صابراً محتسباً…
Usāmah ibn Zayd (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) said: "If you get news of the outbreak of a plague in a land, do not enter it, and if it breaks out in a land in which you are, do not leave it.”
"إذا سمعتم الطاعون بأرض، فلا تدخلوها، وإذا وقع بأرض، وأنتم فيها، فلا تخرجوا منها"