Lights, camera,... reaction

1994 Ford Ranger… I have my headlights on dim and change to bright and then headlights go out. I push the light switch in and pull out and the lights are back on until I pull the dimmer switch again. Sometimes I have to push the light switch in two or three times and pull out until the lights come back on. It is a little scary driving on the highway, then there is darkness. I assume the light switch or the dimmer switch… what do you think?

I’d guess the dimmer switch needs testing and possibly replacing.