The Messenger of Allah ﷺ said, "Fear Allah, fear Allah regarding my companions. Fear Allah, fear Allah regarding my companions. Do not make them targets after me. Whoever loves them, loves them out of love for me, and whoever hates them, hates them out of hatred for me. Whoever harms them has harmed me, and whoever harms me has harmed Allah, and whoever harms Allah, He is about to seize him."
حدثنا محمد بن يحيى حدثنا يعقوب بن إبراهيم بن سعد حدثنا عبيدة بن أبي رائطة عن عبد الرحمن بن زياد
قال رسول الله ﷺ الله الله في أصحابي الله الله في أصحابي لا تتخذوهم غرضا بعدي فمن أحبهم فبحبي أحبهم ومن أبغضهم فببغضي أبغضهم ومن آذاهم فقد آذاني ومن آذاني فقد آذى الله ومن آذى الله يوشك أن يأخذه
[Its chain of transmission is daif]. Ahmad also narrated it, 4/87, through the hadith of Ubayda bin Abu Raita with the same wording, and Ibn Hibban graded it sahih in Ihsan 7212. Abdul-Rahman bin Ziyad is of unknown status, no one deemed him reliable except Ibn Hibban, and it is not established that Tirmidhi said about this hadith that it is hasan (!).