Scared to start High School - Friend Issues

I'm starting freshman year in August 2017 and I wasn't really scared into going to high school until now.

Middle school was the worst, and I don't want the negativity caring into High School. My dad always tells me that it should be the four best years of your life, which makes sense. You're a teenager, trying new stuff and meeting new friends, but it's the old friends I'm scared of experiencing.

Throughout summer, I have been avoiding friends in my life that I know had a bad influence on me in Middle School. They would be racist, rude to others, and made me feel bad about myself. I know what most of you are thinking, why didn't you just leave them? Well, I have a hard time being welcomed into friend groups, in general to people I know, I'm kind and fun to be around, but when it comes to having a "group", I can never stay in one without feeling left out or feeling awkward. So I stayed with them because it was the last semester and I wasn't in the mood to have another embarrassing search for friends. ( Let me put this to mind, I went to a very high praised public school that was mostly filled with wealthy white kids, but I wasn't very wealthy (middle class) and I didn't live in the schools neighborhood, so most kids there acted differently then what I was used to.)

Anyway, the whole point is that now that I'm trying to leave my bad influence friends, I'm scared I'm not going to find a click in high school, and basically be alone forever, which is basically a freshman worst nightmare.

I need help and advise. Sorry it's a long story, but I figured a backstory might make it easier to understand.

Also sorry for an errors.