I read that draining the water heater is general good practice. The problem is that I don't know how to turn off the draining plug. It kept draining water through the night.
Here is a picture of the vent.
Home Improvement Stack Exchange is a question and answer site for contractors and serious DIYers. It only takes a minute to sign up.Sign up to join this community
It looks to me that you turn the hose drain outlet on and off using the knob highlighted below:
This knob looks to be a turn style device. Rotate one way to shut off drain and the other way to turn the drain on. The hose nib for attaching the drain hose looks like it is on the opposite side of the valve assembly as you have pictured it.
If you got the water to drain by another means, such as opening the over pressure switch, you will likely need to replace the whole valve assembly.