Hadith 1758
Abul-Juhaim 'Abdullah bin Al-Harith (May Allah be pleased with him) said:
عن أبي الجهيم عبد الله بن الحارث بن الصمة الأنصاري رضي الله عنه قال: قال رسول الله صلى الله عليه وسلم : "لو يعلم المار بين المصلي ماذا عليه لكان أن يقف أربعين خيرًا له من أن يمر بين يديه" ((قال الراوي: لا أدري قال أربعين يومًا، أو أربعين شهرًا، أو أربعين سنة)). ((متفق عليه)).
The Messenger of Allah (ﷺ) said, "If the person who passes in front of a praying person, realizes the enormity of the sinfulness of this act, it will have been better for him to wait forty than to pass in front of him." [Al-Bukhari and Muslim]. [The narrator was not sure whether the Prophet (ﷺ) said forty days, months or years.]
In plain words
The Prophet said that if someone knew how serious it is to cut across in front of a person praying, he would rather wait a very long time than do it. The lesson is to honour another's prayer by simply waiting instead of walking through.
Reference : Riyad as-Salihin 1758 In-book reference : Book 17, Hadith 248