Keep the door shut and latched at all times. This will deter a young toddler or one who is unable to manipulate the doorknob by himself.
Install a doorknob cover on the bathroom door once your child is able to reach it. Try to put it on before she tries to turn the knob on her own so she doesn't get in. Covers generally come in two pieces that snap together over a knob, and older children and adults can still open the door by pressing in the right spot or through holes in the cover to turn the knob.
Put up a safety gate in front of the door to completely block access. Some children have strong fingers and if they fiddle with the cover long enough they may figure out how to take it off or turn the knob.
Install a toilet lid lock on your commode on the off-chance he is able to get in. The toilet is a dangerous drowning hazard, and if your toddler cannot lift the lid, his chances of drowning are lessened.