I've gone through some similar things, including something I'm dealing with right now, so I can relate. After enough experiences like this, I learned that you have to be proactive about who your friends are. Cut the negative people out of your life and actively seek out good people. If you're not outgoing enough to have an easy time meeting new people, try playing music, making art, or some other activity that will bring good people to you. It's a process, but the more good things you do, the more good people you'll meet and the more choices you'll have about who to hang out with.