I heard the Messenger of Allah ﷺ say, "No one endures the hardship of Madinah and dies there without me being an intercessor or a witness for him on the Day of Resurrection, provided he was a Muslim."
سمعت رسول الله ﷺ يقول: لا يصبر أحد على لأوائها فيموت إلا كنت له شفيعا أو شهيدا يوم القيامة إذا كان مسلما.
Muslim narrated it in the Book of Hajj (1374:477) from Qutayba bin Saeed, who said, Layth narrated to us, from Saeed bin Abu Saeed, from Abu Saeed, the freed slave of Mahri, that he came to Abu Saeed Khudri during the nights of Harra and sought his advice about leaving Madinah. He complained to him about its high prices and the large number of his dependents, and told him that he could not bear the hardship and privation of Madinah.Abu Saeed Khudri said to him, "Woe to you, I will not advise you to do that. I heard the Messenger of Allah ﷺ say" (then he mentioned the hadith).