If you find yourself asking how to wire a light switch then the simple answer is don’t, the amount of times electricians find incorrectly and sometimes dangerously connected light switches is far too often.
A common issue is with metal light switches where the yellow core of a 3 core cable at a 2 way light switch has been connected to the earth terminal of the light switch. When the two way switches are in a certain position the yellow core of the cable will become live.
As many electricians discover on a daily basis DIY electrical works are generally dangerous, non-compliant and normally ends up costing a lot more in the long run due to the costs involved to correct and make safe the DIY works.
Another common issue electricians are finding with DIY fitted light switches is where the earth core of the cable is being used as a live conductor, which of course is non-compliant and dangerous.