Al-Mumtahanah 60:13
يَـٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ لَا تَتَوَلَّوْا۟ قَوْمًا غَضِبَ ٱللَّهُ عَلَيْهِمْ قَدْ يَئِسُوا۟ مِنَ ٱلْـَٔاخِرَةِ كَمَا يَئِسَ ٱلْكُفَّارُ مِنْ أَصْحَـٰبِ ٱلْقُبُورِ
Ya ayyuha allatheena amanoola tatawallaw qawman ghadiba AllahuAAalayhim qad ya-isoo mina al-akhirati kama ya-isaalkuffaru min as-habi alquboor
O you who have believed, do not make allies of a people with whom Allāh has become angry. They have despaired of [reward in] the Hereafter just as the disbelievers have despaired of [meeting] the companions [i.e., inhabitants] of the graves.
O you who believe, do not have friendship with a people with whom Allah is angry. They have despaired from the Hereafter as the infidels have despaired from those (buried) in the graves.