How to flourish in a toxic work environment without going completely insane?

How to flourish in a toxic work environment without going completely insane?