If none of that works, and you've concluded that you have no choice but to quit, here's how to do it:
Negotiate a layoff. It's better than just quitting. You might be able to negotiate a severance package, including a one-time payment of a portion of your annual salary and an extension of your health insurance. Plus, a layoff might make you eligible for unemployment benefits. In exchange, you'll probably have to agree not to claim wrongful termination. Network for a new job—before you leave. Hit up your best contacts—sometimes, that can help land a new job quickly. Make the time to research jobs and careers that might best fit your skills or personality, to make your networking more effective. But if you're tempted to shirk at a job you know you'll be leaving, don't. It's unfair to your coworkers and could lower the quality of your references.
Prepare for a long job hunt. It might take a few months, so even though it's not ideal, you'll probably have to quit before you've lined up your next gig. Many people find that it's easier to stay upbeat by joining a job-seeker group. My favorite is the Five O'Clock Club.
Secure good references. If possible, get reference letters before you leave, so you can hand them out on the spot if necessary. Before asking your boss for a recommendation, set the stage by first finding something nice to say about him or her or the company. Reminisce about projects that worked well.
Hold your tongue. Don't bash your boss or your company in chats with coworkers, and try to stay positive in a resignation letter or exit interview—you never know when you'll need to ask for a favor. Don't bad-mouth your employer in job interviews either; it could get back to your former colleagues and ruin your reference. Besides, it's unseemly. If you can't resist dispensing a lecture on how to improve that asinine organization you used to work for, at least wait until you're firmly installed in your new job.