Lidocaine is one of the most commonly used local anesthetics, and can be injected or placed directly on the skin. Scientists believe that local anesthetics work by blocking nerve impulses, keeping sodium -- an essential part of communications between nerves -- from getting through the nerve's membrane. Cocaine is another type of local anesthesia, sometimes used to numb the nasal passages for surgical procedures.

Anesthesia can also be administered regionally, by injecting it into the spinal fluid or the space outside the spinal canal, called the epidural. This approach is often used to ease women's pain in childbirth.
For major surgery, anesthesia is administered generally, so that the patient is fully unconscious. Scientists are unsure how general anesthesia works at the cell level, but it seems to numb the spinal cord (producing immobility), and the cerebral cortex (causing unconsciousness). General anesthetics can be either inhaled or injected. If injected, the drug enters the bloodstream directly and travels quickly to the brain. Inhaled anesthetics enter the lungs, and are carried by the bloodstream to central nervous system cells.
Why fast before surgery?
Patients scheduled for surgery requiring general anesthesia are often told not to eat anything for eight hours beforehand. This is because we lose the ability to swallow food and drink without choking while under anesthesia. The act of swallowing includes a reflex action that covers the opening into the lungs; anesthesia numbs that reflex. So any solids or liquids in our stomachs could travel up into the mouth and be inhaled into the lungs, causing serious damage.
