Once you have the general anesthesia in your system it can take as long as 24 hours for the general anesthesia to get out of your system fully.
So while you may be awake immediately or within a few minutes or so of coming off the anesthesia after surgery you will still have the general anesthesia in your system for as long as 24 hours.
While most who were given general anesthesia most people are awake in the recovery room immediately after an operation but remain groggy for a few hours afterward.
So if you're gonna go to the hospital even for a simple procedure but need to be sedated with anesthesia then you need someone to drive you home if you're gonna be discharged from the hospital that day.