I'd like to expand on Don Eilenberger's helpful dissection of the K bike headlight switch. My story looks like I'm heading towards a switch replacement, but after my light wiggled off last night coming home, I was prompted to follow his instructions and take my switch apart hoping I could clean and repair my switch.
2 prep items I added to his, I laid a couple of large light colored towels on the ground under the area to highlight and capture any rogue parts that I might miss, and I used a couple of largish floppy magnets to hold my screws in roughly the same pattern as they came out of the switch. Including the spring that rests on top of the horn button screw and is between the handlebar and the switch. I didn't have a brass piece he describes with THIS outer spring, HOWEVER, when you take the button off the switch, there is another spring inside the button itself and in THAT spring there's an infamous brass thingy. As you unscrew the horn button from the switch, you should be able to allow the button to fall into your palm, with the spring and the brass piece staying put in their stem.
I can attest and aver that the horn will sound if you forget to replace the spring that rests atop the horn button securing screw between the handlebar and the switch casing when you screw the switch back onto the handlebar!
When you get to the light switch itself be aware: There will be 3 springs to control when you take the switch out of its housing. 2 are on the right side of the switch (with switch oriented as it's supposed to sit) and 1 is on the left side. The ones on the right are behind the brass contacts for the lights, the one on the left is behind the upper ball bearing pivot Don describes. BE CAREFUL as you remove the pivot the switch button rotates on; as you take the pivot out, look and plan where you're going to place your fingers to secure the springs as you re- move the switch.
As he describes, Your Outcome May Vary as to whether this will cure your woes, but it was a pretty straightforward operation using reasonable caution.