Purchase a dimmer box. If you are rigging just one light (or two small ones) to flicker, you should get by with just one dimmer box. If you plan on rigging more, get two or three. These boxes are inexpensive and available at most large hardware stores or lighting specialty stores. They consist of a standard plug, a socket or two, and a dimming knob or slide. If you plan on rigging a light with much higher wattage than a handful of dimmer boxes can handle, you will need a professional lighting console.
Rig the light to the box. Just plug your lamp or light into the box, and plug the box into your power source. If the light source you want to flicker is off-frame, rig your film lamp to the dimmer box. If it is an on-screen practical lamp or light bulb, rig that to the dimmer box out of the frame. Make sure you do not overload the dimmer box with a higher wattage than it is rated for.
Practice the flicker effect. Have your gaffer or another crew member rapidly switch on and off the switch or roll the dimmer quickly back and forth for a smoother effect. If you are shooting digitally, watch the effect in the monitor, as the flickering will look different to the naked eye than to your camera. If you are shooting film, you might consider tests to see how the flicker effect works. Generally, the more irregular the flicker pattern, the more natural it will appear on screen.
Shoot the scene. Your gaffer or crew member operating the dimmer box should begin the effect before the director calls action. There will likely be a delay as the operator gets started and establishes a rhythm, so you want to avoid any appearance that the flicker is beginning simultaneous to your scene.