Sahih Muslim, Book 44, Hadith 7 (Muslim 6110)

Abdullah reported Allah's Messenger (ﷺ) as saying:

If I were to choose amongst the people of earth someone as my bosom friend, I would have chosen the son of Abu Quhafa as my friends but God has taken your companion as a friend.