Quran 60:1-8 Meaning
You can refer to the explanation given in Al-Bayan at the following link and ask a follow-up question in case of any confusion: https://www.javedahmedghamidi.org/#!/quran?chapter=60¶graph=7&type=Ghamidi
You can be friends with non-muslims.