What have you heard from Messenger of Allah ﷺ about plague? Thereupon Usama said: Messenger of Allah ﷺ said: Plague is a calamity which was sent to Bani Isra'il or upon those who were before you. So when you hear that it has broken out in a land, don't go to it, and when it has broken out in the land where you are, don't run out of it. In the narration transmitted on the authority of Abu Nadr there is a slight variation of wording. (Using translation from Muslim 2218a)
سَمِعْتَ مِنْ رَسُولِ اللهِ ﷺ فِي الطَّاعُونِ؟ فَقَالَ أُسَامَةُ سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ رِجْزٌ أُرْسِلَ عَلَى طَائِفَةٍ مِنْ بَنِي إِسْرَائِيلَ أَوْ عَلَى طَائِفَةٍ مِمَّنْ كَانَ قَبْلَكُمْ الشَّكُّ فِي الْحَدِيثِ فَإِذَا سَمِعْتُمْ بِهِ بِأَرْضٍ فَلَا تَقْدَمُواعَلَيْهِ وَإِذَا وَقَعَ بِأَرْضٍ وَأَنْتُمْ بِهَا فَلَا تَخْرُجُوا فِرَارًا مِنْهُ قَالَ أَبُو النَّضْرِ فِي حَدِيثِهِ لَا يُخْرِجُكُمْ إِلَّا فِرَارًا مِنْهُ