So you're working for the contracting company? Then you resign to them. I always find these things easier in person and I'd encourage you to be very very open & honest with your contracting boss about why you need an immediate exit.
A situation that might suit all parties would be for you to take a week off starting immediately (a mix of holidays earned and sick leave). That gives you a week to calm down, de-stress and stand back from the situation. Then you'll be able to come back for a day or two to tie up any loose ends / train a replacement. It's not ideal but it's better for everyone than if you do a runner (and you should sell your boss on this plan in this way).
Bear in mind that stress/depression/anxiety/panic attacks (apologies, I'm reading between the lines a lot) will easily have you on medically-certified leave for >2weeks
A situation that might suit all parties would be for you to take a week off starting immediately (a mix of holidays earned and sick leave). That gives you a week to calm down, de-stress and stand back from the situation. Then you'll be able to come back for a day or two to tie up any loose ends / train a replacement. It's not ideal but it's better for everyone than if you do a runner (and you should sell your boss on this plan in this way).
Bear in mind that stress/depression/anxiety/panic attacks (apologies, I'm reading between the lines a lot) will easily have you on medically-certified leave for >2weeks