I've done it a few times, not too hard once you figure it out.
It may be easier to do if you remove the lower 'knee bolster' part of the dash...
You'll need a clear view of the underside of your dash, so get prepared to get inverted. On the bottom of the switch, there is a button you'll need to press. This frees up the 'push/pull' plunger part; pull the plunger all the way out, completely free of the housing. (If it won't come out, don't force it; you need to press harder on the button. Maybe wiggle it a bit.)
Once the plunger is out, you'll notice the silver metal backing that was hiding behind the plunger has a slot through it; you can use a big slot screwdriver to unscrew it and this will free your headlight switch from the dash.
There is a wire harness clipped to the back of the switch, and there isn't a lot of slack to get a good look at it; what's more, I can't recall if there's a trick to getting the harness and switch to separate. I don't think there is, but that hard work is done.
Someone might come up with a better description; if so, I'll just blame it on lack of sleep and cough medicine.