Muslim and non-Muslim relationship

Question Assalamualaikum Are muslims and non muslims allowed to be friends? There are a few verses where Allah has commanded muslims not befriend jews, Christians and idolaters. However I have heard many scholars say that it is ok to be friends with non-muslims even...