The Prophet ﷺ said, "Whoever falsely swears by a religion other than Islam is as he has declared himself. Whoever kills himself with something will be tormented with it in the fire of Hell. Cursing a believer is like killing him, and accusing a believer of disbelief is like killing him."
عن النبي ﷺ قال: من حلف بملة غير الإسلام كاذبا فهو كما قال، ومن قتل نفسه بشيء عذب به في نار جهنم، ولعن المؤمن كقتله، ومن رمى مؤمنا بكفر فهو كقتله.
Bukhari narrated it in the Book of Manners (6105), and Muslim in the Book of Faith (110), both from the hadith of Abu Qilaba, from Thabit bin Dahhak, and he related the hadith. The wording given is that of Bukhari, while Muslim's wording is abridged, and he did not mention the statement, "and cursing a believer... etc."