Get a new job first. Then quit. Downside: You're in a sucky environment for 1-6 months longer. Upside: You have a LOT more negotiating leverage for your next job.
It depends. If you're "hot" in the market and/or if you have a big emergency fund, consider having a 1-2 month mini-sabbatical between jobs (you can even ask the new employer to postpone the starting date). You will never get a chance like that. Of course, it doesn't always work, it really depends on the situation.
There's no guarantee you can find a new job right away, no matter how hot your skills are or how brilliant you are.
Also, you have less negotiating leverage when you're unemployed. If you are currently making $X and you get an offer for $X, you probably could negotiate for $X+10 or $X+20. If you're unemployed, and have been on the market awhile, you might get lowballed into taking $X or $X-10.
That actually happened for my current job. The boss was considering initially offering me my current salary, but I honestly said "I'm not so sure. Maybe I'll just keep looking instead." Then he wound up offering a 30% rate increase.