Surah An-Nur 24:27
يَـٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ لَا تَدْخُلُوا۟ بُيُوتًا غَيْرَ بُيُوتِكُمْ حَتَّىٰ تَسْتَأْنِسُوا۟ وَتُسَلِّمُوا۟ عَلَىٰٓ أَهْلِهَا ۚ ذَٰلِكُمْ خَيْرٌ لَّكُمْ لَعَلَّكُمْ تَذَكَّرُونَ
O you who have believed, do not enter houses other than your own houses until you ascertain welcome and greet their inhabitants. That is best for you; perhaps you will be reminded [i.e., advised].
Translation: Saheeh International
Tafsir
O you who believe do not enter houses other than your houses until you have first asked permission and greeted their occupants. So a person must say ‘Peace be upon you may I enter?’ as is stated in one hadīth. …
Excerpt from Tafsir al-Jalalayn, commentary on 24:27, via Quran.com. The reader has the full commentary and 9 more tafsirs.