Sahih Muslim 304
The Book of Faith
حَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، وَإِسْحَاقُ بْنُ مَنْصُورٍ، وَعَبْدُ الْوَارِثِ بْنُ عَبْدِ الصَّمَدِ، كُلُّهُمْ عَنْ عَبْدِ الصَّمَدِ بْنِ عَبْدِ الْوَارِثِ، عَنْ شُعْبَةَ، عَنْ أَيُّوبَ، عَنْ أَبِي قِلاَبَةَ، عَنْ ثَابِتِ بْنِ الضَّحَّاكِ الأَنْصَارِيِّ، ح
It is narrated on the authority of Thabit b. Dahhak that the Messenger of Allah (ﷺ) observed:He who took deliberately a false oath on a religion other than Islam would become that which he had professed. And he who killed himself with anything Allah would torment him with that in the Fire of Hell
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.