Front left headlight sometimes works sometimes doesn't. I replaced the headlight socket still it didn't help. I switch the bulb still it the same thing. If the headlight doesn't work, I flash the highbeam 4-5 times the light might come back on or turn the headlight on/off switch 4-5 times it might come on.
The problem is likely either in the switch itself or somewhere in the wiring to the bulb. I would check all of the wiring to see if I could find any of it that has worn through.
I think it is likely that your switch is bad, but there is no way for me to know for sure.