General anesthesia makes you both unconscious and unable to feel pain during medical procedures. General anesthesia is commonly produced by a combination of intravenous drugs.
The “sleep” you experience under general anesthesia is different from regular sleep. The anesthetized brain doesn’t respond to pain signals or surgical manipulations.