Sahih al-Bukhari 3380
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 `Umar:
When the Prophet (ﷺ) passed by (a place called) Al Hijr, he said, "Do not enter the house of those who were unjust to themselves, unless (you enter) weeping, lest you should suffer the same punishment as was inflicted upon them." After that he covered his face with his sheet cloth while he was on the camel-saddle.
Full reference and source
Sahih al-Bukhari 3380 In-book : Book 60, Hadith 24 USC-MSA web (English) : Vol. 4, Book 55, Hadith 563 (deprecated)
View source on Sunnah.com (opens in a new tab)