Sahih al-Bukhari 5730
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
إِذَا سَمِعْتُمْ بِهِ بِأَرْضٍ فَلاَ تَقْدَمُوا عَلَيْهِ وَإِذَا وَقَعَ بِأَرْضٍ وَأَنْتُمْ بِهَا فَلاَ تَخْرُجُوا فِرَارًا مِنْهُ "
Narrated `Abdullah bin 'Amir:
`Umar went to Sham and when he reached Sargh, he got the news that an epidemic (of plague) had broken out in Sham. `Abdur-Rahman bin `Auf told him that Allah's Messenger (ﷺ) said, "If you hear that it (plague) has broken out in a land, do not go to it; but if it breaks out in a land where you are present, do not go out escaping from it."
Full reference and source
Sahih al-Bukhari 5730 In-book : Book 76, Hadith 45 USC-MSA web (English) : Vol. 7, Book 71, Hadith 626 (deprecated)
View source on Sunnah.com (opens in a new tab)