In the years after the Prophet ﷺ's death, wealth began to flow into Madinah and some Companions built larger houses. Abu Dharr al-Ghifari RA confronted them about this again and again, and many complained. In the end the caliph, Uthman ibn Affan RA, asked him to leave Madinah. Abu Dharr agreed. He went to live in the desert with only his wife and a young servant.
The rest of the story is reported by Ibn Sa'd. Many years later, during the caliphate of Ali ibn Abi Talib RA, Abu Dharr lay dying. His wife wept, because she had no cloth to shroud him and no strength to bury him. He told her not to cry. He reminded her that he had once been sitting with a group of Companions when the Prophet ﷺ said, "One of you will die all alone, yet a group of believers will pray over him." Every other man in that gathering had already died, and none of them had died alone. He was the only one left in the wilderness, so he knew someone would come.
He told her to take his body to the roadside after he died. She asked why anyone would come by, since it was not the season of Hajj. He insisted, swearing that he was not lying and had not been lied to.
Abu Dharr passed away, and his wife did as he had said. Almost at once, a large caravan appeared on the road. Among the travelers were Abdullah ibn Mas'ud RA and Ammar ibn Yasir RA. The servant called out to them to stop and help bury a Muslim. When they learned it was Abu Dharr, Ibn Mas'ud wept and said, "The Prophet ﷺ has spoken the truth." The travelers gave their own clothes for his shroud, prayed the funeral prayer over him in the desert, and buried him.