Depends on how urgent/serious it is. They can be done under anasthetic usually called a crash section, as mother & babies lives at risk. Or most usually they are done under a spinal block or epidural. Mine was done with a top up epidural as my DD was not coming out!
Someone close to me has had an emergency CS and had an epidural.
Another birth was via crash CS, under general anaesthetic (the baby was in distress and I believe they had lost the heartbeat. Her partner was pretty much shoved into the corridor and she was given a general anaesthetic more or less immediately.
(Fortunately it had a happy ending with a healthy baby and a mother who was not at all traumatized by the experience.)