From Sahih Muslim (Hadith 6674):
Abu Barza reported that he said to Allah's Messenger (ﷺ):Allah's Messenger, I do not know whether I would survive after you, so confer upon me something by which Allah should benefit me. Thereupon Allah's Messenger (ﷺ) said: Do this and that and remove the troublesome things from the paths
Reference: Muslim 6674