It is narrated from Sayyiduna Abdullah bin Amr bin al-As (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "The best companion (travel partner) in the sight of Allah Almighty is the one who is best to his companion, and the best neighbor in the sight of Allah Almighty is the one who is best to his neighbor."
Brief Explanation
(Commentary on Hadith 2473)
In this hadith, there is encouragement to choose good companions for travel and to behave well with one's fellow travelers.
Similarly, it teaches good conduct towards neighbors, and that neighbor is very beloved to Allah who takes care of his neighbor, does not harm him, and shares in his joys and sorrows.