كتاب الحج
15  
The Book of Pilgrimage
(86)
Chapter: Encouragement to live in Al-Madinah and to be patient on bearing its distress and hardships
(86)
باب التَّرْغِيبِ فِي سُكْنَى الْمَدِينَةِ وَالصَّبْرِ عَلَى لأْوَائِهَا ‏‏
Sahih Muslim 1374 d

Abu Sa'id Maula al-Mahri reported that he came to Abu Sa'id al-Khudri during the nights (of the turmoil) of al-Barrah, and sought his advice about leaving Medina, and complained of the high prices prevailing therein and his large family, and informed him that he could not stand the hardships of Medina and its rugged surrounding. He said to him:

Woe to you; I will not advise you to do it, for I heard Allah's Messenger (ﷺ) as saying: No one will endure hardships of Medina without my being an intercessor or a witness on his behalf on the Day of Resurrectiar), if he is a Muslim.
وَحَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، عَنْ سَعِيدِ بْنِ أَبِي سَعِيدٍ، عَنْ أَبِي سَعِيدٍ، مَوْلَى الْمَهْرِيِّ أَنَّهُ جَاءَ أَبَا سَعِيدٍ الْخُدْرِيَّ لَيَالِيَ الْحَرَّةِ فَاسْتَشَارَهُ فِي الْجَلاَءِ مِنَ الْمَدِينَةِ وَشَكَا إِلَيْهِ أَسْعَارَهَا وَكَثْرَةَ عِيَالِهِ وَأَخْبَرَهُ أَنْ لاَ صَبْرَ لَهُ عَلَى جَهْدِ الْمَدِينَةِ وَلأْوَائِهَا ‏.‏ فَقَالَ لَهُ وَيْحَكَ لاَ آمُرُكَ بِذَلِكَ إِنِّي سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ لاَ يَصْبِرُ أَحَدٌ عَلَى لأْوَائِهَا فَيَمُوتَ إِلاَّ كُنْتُ لَهُ شَفِيعًا أَوْ شَهِيدًا يَوْمَ الْقِيَامَةِ إِذَا كَانَ مُسْلِمًا ‏"‏ ‏.‏
Reference : Sahih Muslim 1374d
In-book reference : Book 15, Hadith 543
USC-MSA web (English) reference : Book 7, Hadith 3175
  (deprecated numbering scheme)