He came to Abu Saeed Khudri during the nights of the Harrah and consulted him about leaving Madinah. He complained to him about its high prices and his large family, telling him that he could no longer endure the hardship and harshness of life in Madinah.Abu Saeed said to him, "Woe to you, I will not advise you to do that. I heard the Messenger of Allah ﷺ say, 'No one endures its hardship and dies but that I will be an intercessor or a witness for him on the Day of Resurrection, provided he is a Muslim.'"
أنه جاء أبا سعيد الخدري ليالي الحرة، فاستشاره في الجلاء من المدينة، وشكا إليه أسعارها وكثرة عياله، وأخبره أن لا صبر له على جهد المدينة ولأوائها، فقال له: ويحك لا آمرك بذلك، إني سمعت رسول الله ﷺ يقول: لا يصبر أحد على لأوائها، فيموت، إلا كنت له شفيعا أو شهيدا يوم القيامة إذا كان مسلما.
Muslim narrated it in the book of Hajj (13: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, and he mentioned it. There are other hadiths with similar meaning mentioned in the virtues of Madinah.