Whatever your reason for quitting, there's a right way and a wrong way to leave your job. Even if you hate the job, hate your boss, and hate your co-workers, you should leave with a certain amount of grace. When I quit the worst job I ever had to take another role in Price Waterhouse, my boss snarled at me and said "That's ok, Kalish, you're a freaking denominator". (He was referring to the fact that in the partnership a major metric on which he was measured was 'revenue per partner'. He was happy to see me go because with the same revenue his numbers would increase.) I was never happier to leave a job.
Should you quit before you find another job? In general, I would say no. It's easier to get a job when you have a job. It gives your future boss a certain confidence to know that at least one other company out there wants you. It also gives you some flexibility at not having to panic if it takes a couple of months - or more than a year - to find a new position. Especially if you have benefits, the lost wages can be significant. That said, some situations are just unbearable and you have to leave them asap. You have to make the decision.
Let's look at some of the reasons for quitting and then how to do it right.