Many people have problems with headlight switch on Datsun 240, 260, and 280Z series.
If you have a switch that does not work, give it a shot. You take everything apart, and clean all the conductors and grease it up. If the spring loaded plastic clicking parts are broken, bad luck……….But usually this should fix intermittent issues. If you want, paint it in semi-gloss and finished it with white paint into letters as shown in the pictures.