3:28 Let not the Believers take the Unbelievers as friends— rather than the Believers. And whoever does that, then there is nothing from Allāh in any matter; unless that you only protect yourselves from them a protection. Thus Allāh cautions you of Himself; for towards Allāh is the eventual coming.
3:28 The Qur’ānic instruction of not taking the unbelievers as friends must be carefully analyzed and understood in the context of the circumstance under which the verse was revealed. The verse and sūrah was revealed in 3 A.H./625 C.E. after the battle of Badr and Uhud when the Muslims were in a state of confrontation with the unbelievers. Keeping this backdrop in mind, whenever conditions are hostile, people of other faith causing the hostility cannot be trusted to uphold the interest of the Muslims (cf. 3:118; 5:51; 60:8-9). According to Rāghib, the key word wali (Pl. auliya) commonly understood to be ‘friend’, ‘a close person’, ‘an executor’, ‘a guardian’ etc. refers to nearness or friendship with respect to help and belief. Under such circumstance if someone makes alliance or friendship with the enemies, then they are on their own, Allāh would not protect them. The message of this verse does not apply to casual friendship at work or school since 60:8-9 expressly allow making friendship with unbelievers who are not hostile to the Muslims and circumstances of war does not exist between them.