Allāh ﷻ tells us to be with the truthful. Our Prophet ﷺ is foremost among the truthful, so be with him ﷺ and those who follow his ﷺ way. Some people may look like friends, but follow their ego and run away when difficulty comes. Stay with good people who advise you, help you, and keep you on the way of Allāh ﷻ.