Sahih Muslim 246
The Book of Faith
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى التَّمِيمِيُّ، وَعُثْمَانُ بْنُ أَبِي شَيْبَةَ، كِلاَهُمَا عَنْ جَرِيرٍ، قَالَ يَحْيَى أَخْبَرَنَا جَرِيرٌ، عَنِ الأَعْمَشِ، عَنْ أَبِي سُفْيَانَ، قَالَ سَمِعْتُ جَابِرًا، يَقُولُ سَمِعْتُ النَّبِيَّ صلى الله عليه وسلم يَقُولُ " إِنَّ بَيْنَ الرَّجُلِ وَبَيْنَ الشِّرْكِ وَالْكُفْرِ تَرْكَ الصَّلاَةِ " .
It is narrated on the authority of Jabir that he heard the Apostle (may peace and blessings be upon him) saying. Verily between man and between polytheism and unbelief is the negligence of prayer
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.