Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:4:139

Those who take disbelievers as allies instead of the believers. Do they seek with them honor ˹through power˺? But indeed, honor belongs to Allah entirely.  

Those who (alladhīna, is either a substitution for, or an adjectival qualification of, al-munāfiqīna, ‘the hypocrites’) take disbelievers for friends instead of believers, because they mistakenly believe them to be strong — do they desire, ˹do˺ they seek, power with them? (an interrogative of disavowal), that is to say, they shall not find such ˹power˺ with them. Truly, power belongs altogether to God, in this world and the Hereafter, and none but His friends shall attain it.
القرآن:٤:١٣٩

الَّذِينَ يَتَّخِذُونَ الْكَافِرِينَ أَوْلِيَاءَ مِنْ دُونِ الْمُؤْمِنِينَ ۚ أَيَبْتَغُونَ عِنْدَهُمُ الْعِزَّةَ فَإِنَّ الْعِزَّةَ لِلَّهِ جَمِيعًا  

{الذين} بدل أو نعت للمنافقين {يتخذون الكافرين أولياء من دون المؤمنين} لما يتوهمون فيهم من القوة {أيبتغون} يطلبون {عندهم العزة} استفهام إنكار أي لا يجدونها عندهم {فإن العزة لله جميعا} في الدنيا والآخرة ولا ينالها إلا أولياؤه.