Often I read about people waking up after being unconscious or asleep in a story. Some authors write the characters as being confused, and it taking a second to remember what was happening before. I'm wondering if this is a real reaction, or just a way to add details. Are there any other details can I add besides the environment around them?
You can use it for characterization as well as storytelling.
I think one of the most important factors for how the character wakes up and what they do are who they are (personality, neuro divergence, habits, psychology, etc.) Another is what happened to them before.
It sometimes happens that when I wake up I'm in a limbo zone between sleep and wake, where the connection between my conscious and unconscious mind seems extra strong, and some thoughts I've had during this time have been very profound. Your readers will likely have had this experience as well and might put extra emphasis on what the character thinks during this time.
For instance, I'm a person that likes puns. I'm also a person that has problems with sleep. And time is also a problem. Oversleeping is not unheard of. So the morning the first thought through my head was "this will bend adly" was rather characterizing for me. (And yes, I made that backward talk up then an there... or rather, it felt like my unconscious did...) What I did after having that thought (laughed and wrote it down) is also pretty characterizing.
Showing how the character's morning routine looks is another way to characterize. Do they jump out of bed to do pushups while the coffee brews, do they moan and snooze the alarm or something in between?
Depending on how the character lost consciousness the reaction to waking up can be different. For instance, do they remember where they were when they lost consciousness? Are they waking up in an unusual place? Sometimes it can be enough to fall asleep "upside down" in bed to wake up really confused (that is also really characterizing, who does that?) You can get similar effects from forgetting you're in a hotel room and not at home.
I have no experience of waking up from surgery, but I've had surgery, so my guess is that one predominant experience after surgery might be pain first of all.
I've woken up from sleep after a night of drinking more than once and pain can be pretty high up there as well (though more of a headache). I guess you could have a blackout about going to bed and wake up confused, but otherwise, it pretty much works like regular sleep (+ possible headaches and dehydration).
Losing consciousness due to other reasons (crimes or accidents) might work like getting blackout drunk. It's pretty obvious that if you're a woman and, after a night at the bar, wake up on the floor in your apartment with no memory of how you got there, your wakeup is going to be harrowing at best.
At what point in the sleep cycle you wake up (deep sleep or REM sleep) can also have a profound impact on how clearheaded you are. If you wake up to an alarm and it's the same time every day, you're likely to be totally clear and aware as soon as you wake up (or even before the alarm goes off), even more so if you use a sleep app.
If, on the other hand, you're out of sync and get woken up during deep sleep, you could be very groggy and confused and need some extra time to figure out where you are. In extreme cases, I've felt like I was drunk. (i.e. so unstable I had to support myself against things to not trip—bouncing between the walls so to speak...)
I guess a final factor would be how urgent you need to visit the bathroom. You're not likely to spend much time smelling the roses if you're seeing yellow submarines...