You’d think a lot of workplaces would be staffed by adults, but they’re really just overgrown high schoolers!

I used to work in a place like that… you’d think that a library would be a quite haven of sanity, but not at all…!
While you’re in it, the best you can do is to be above it. Don’t get involved, be polite to everyone, don’t try to be friends with anyone. Show up, do your job, and go home.
Figure out if your current workplace has any benefits that you can take advantage of. Some employers, for example, do tuition reimbursement. So if you need to get some additional training or education that will open doors for you, see if they have any programs that will benefit you before you cut them loose. Likewise, some employers have penalties if you take advantage of such benefits and then you leave within a certain amount of time… so see if you can move laterally within your company, but otherwise plan out your timeline so that you don’t get penalized for cutting them loose too soon.
You don’t want to just run away from, because there’s a good chance that no matter where you go, you’ll have a similar environment in your new workplace, just with different names and different faces. Because people are people. You want to have a solid plan, a goal, and a destination to work towards, so that even if you end up in another somewhat-toxic environment, you’ll be happy enough with your work (and your hours and your pay) to tolerate or ignore it.