phb. 197
“When you drop to 0 hit points, you either die outright or fall unconscious, as explained in the following sections”
Following sections then go over saving throws for death vs instant death, continues, “If damage reduces you to 0 hit points and fails to kill you, you fall unconscious. This unconsciousness ends if you regain any hit points”.
There is a homebrew that allows you to be conscious while at zero (but be actively dying and unable to perform any actions other than 5 ft of movement on your turn), but in general unless your DM allows you to be awake for some reason, going to 0 hit points automatically knocks you out.