I've had some pretty crappy luck with jobs, and worked in very unhealthy (emotionally toxic) environments. In each case I have no idea what *type* my coworkers were, other than assholes. In each case I've simply walked away. But I also realize a few things about *myself*, as an infj that have contributed to me feeling unhappy.
First, we've got all this emotion, ours and other's, flying around, and no way to get rid of it. So we internalize it. If a person is in a bad mood and curt, it instantly becomes our fault, even if it probably had nothing to do with us. Or we get annoyed that they're taking it out on us, when they're probably just trying really hard to mind their own business and not involve anybody. If there 's drama, we instantly want to get involved and sooth ruffled feathers, largely because we can feel the tension and just want it to stop. We also don't take criticism well. That's important, because some people have a hard time expressing it in a way that's positive and fluffy enough for us to not be threatened by it.
Another thing that occurs to me, and this is really important, of all the types, we are probably the first ones to feel any tension or toxicity, simply because we're so damned sensitive. An INTP, for instance, could easily work in a place for years and not even notice, because he's in his own little world and so long as he's stimulated, the goings on of mere mortals means nothing.
One thing I realized very early on in my first job, is that not matter where you work or what you do, there is always going to be at least one person you don't get along with. If it's your boss or someone higher up than you, this can be a real problem. If it's a co-worker, depending on how much you interact with them, it's generally not quite so bad. Another thing I found works is to try very hard to just shut off the noisy emotions around me, or simply consider the source. I've only been at this job 8 weeks, and everyone I work with is more or less happy, except one. This person is, I believe, very much an INTP, and he has to talk to (what he considers to be) stupid people on the phone all day. Imagine the hell he must be in...that would be an INTP's worst nightmare. So yes he mutters and bitches and makes negative comments, and I give him what he wants: I leave him alone.
If you're in a toxic environment, you can't change it. Just get out. Figure out what your forte is, and find a job that suits you. I love people, and I love being around them, even if I don't always want to interact, so a large company is suitable for me. Being challenged with new things all the time, almost to the point of being overwhelming is what I excel at, and I've found that in my new workplace. But yet I have no one looking over my shoulder, and the company recognizes that good people have quirks and idiosyncrasies that need to be accomodated. Also, sometimes just faking can help too. Being more E, for instance, or definitely less J. And above all, just do your own time.