Completely covering the lens during the exposure will prevent unwanted light from making it into the camera.
This is a very useful trick for a number of reasons:
1. It allows you to use a light so that you can physically see and move to a desired area.
2. It lets you use tools that have a cumbersome switch.
3. Essentially it is not exposing, so you can take your time to prepare the next trick (eg: can prevent the sky from blowing out).
This is most effective when another person is standing at the camera ready to cover the lens.
An easy way to do it is to put the lens cap on. I would still avoid pointing any light at the camera because lens caps are not light tight.
I have also just used my hand to cover the lens. Also, moving your hand over the lens in a pattern can create interesting effects when shooting a moving light source.
Another option is to put a dark cloth over it - a t-shirt works.
Try it out!