Knowing where to get attached to and to understand what kind of people is to be kept near defines our quality of life. Good company enlightens us and bad company drag us down without mercy. It is difficult to choose people and make  borders as everyone is needed in life at one point or other. But this skill defines our success and the learning curve we are going to be in.
According to me intelligence is measured by the skill of detachment , viz the skill for calmly observing and taking decisions to evolve oneself according to the situation. Neglecting the bad ones is not a perfect choice. But finding a way to handle the bad guys always gives us a better connection. In my experience the good ones may not be there  at our bad times, they may be dying for their own success that they may not even have the guts to handle others problems and failures , sometimes they might be repugnant about the same.
So who is to be held near and who to be held at a safe distance???
I feel it depends upon the level of trust one feels about other person , it not only depends on interactions between yourself s but one should be smart enough to observe how other person is treating different people , this will help you to decide whether to trust this guy or not.

Other thing is loyalty . when you are in a trouble however  small it is , see how the person treats you . if he really cares for you, he or she will be patient enough to spent quality time with you and make you feel better. And will share your sadness and share his or her shoulder to weep it out. Remember “however small it is” be cause they care for you and want you to be happy . If it means something to u , it is all that is needed for him or her. But the other guys just will belittle you for being concerned about such a small problem , as per his or her opinion. Wait for it you will be ditched in near future because the other person is looking  for your experience s and not your company. He will learn and use you and go off shrugging .

Choose whom to be around with, don’t waste energy on those who you cannot trust and are not loyal to you.