Sure An-Noor

24:27

يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ لَا تَدْخُلُوا۟ بُيُوتًا غَيْرَ بُيُوتِكُمْ حَتَّىٰ تَسْتَأْنِسُوا۟ وَتُسَلِّمُوا۟ عَلَىٰٓ أَهْلِهَا ۚ ذَٰلِكُمْ خَيْرٌۭ لَّكُمْ لَعَلَّكُمْ تَذَكَّرُونَ

O die ihr glaubt, betretet nicht andere Häuser, die nicht eure (eigenen) Häuser sind, bis ihr euch bemerkbar gemacht und ihre Bewohner begrüßt habt. Das ist besser für euch, auf daß ihr bedenken möget!

Tafsir 24:27

O those who have faith in Allah and act on His sacred law, do not enter houses besides your own houses until you seek permission from their inhabitants to enter them and you greet them, by saying in greeting and seeking permission: “Peace be on you, can I come in?” That seeking permission you have been ordered is better for you than entering suddenly, so that you remember what you have been ordered and then carry it out.