The headlight switch is attached to a face plate using two clips on either side of a tunnel that’s part of the face plate casting. Also, the knob holds the switch in position. To remove the knob, I turn it counter-clockwise.
The two clips are easier to slip off when the face plate is free of the dashboard. To free it, I use a deep 8mm socket to loosen the two nuts that fits onto two studs that are part of the face plate and fit through holes in the dashboard.
With the knob off and the clips free, the switch can be shoved free of the face plate (towards the front of the car). The switch has a large side-fitting plug that attaches it to the wiring harness.