Luckily, opioids can be swapped for other medications that are less effective, like high dose NSAIDs. There's also local anesthetics for some stuff.
In that case, they don’t seem to work that well for me. Or maybe they do it differently here.
I always remember going into the OR and being prepped.
My anxiety for my last surgery was huge up until the moment I passed up. The best I got was the anaesthesist telling me it was normal for someone in my circumstances (I’d not had anxiety the last few times, so was very confused as to why I had so much this time, I was freaking for some reason)
You may also require either a higher baseline dose than expected, and an onset of acute anxiety can actually affect dosing too. Both totally normal!
Either way, it's best to speak with your doctor leading up to surgery if that experience was upsetting. There's lots that can be done for dosage, supplemental medication, etc. Your comfort is important!
Before surgery, you're given an amnestic to help reduce immediate anxiety and avoid remembering going into the OR and getting prepped - which people don't generally enjoy.
Then you get the anesthesia, which puts you to sleep. They put you on a respirator, which - alongside helping your barely/non-working lungs - delivers a gaseous anesthesic to keep you asleep.
Because some reactions to pain are reflex, they may still work. And when you wake up, they don't want you to be in pain; especially if that's on the surgery table. So next, you get the analgesic opioids. Here you may also (if you didn't already) get paralytics to stop all muscle movement.
Rest assured that they are not YOLO-ing your pain and suffering. You are given a cocktail of drugs to make sure you are comfortable before, during, and after surgery.