By far the most common problem is a loose wire connection at the switch itself, which is subject to constant on-off usage. Less commonly, a light bulb socket may go bad. If so, you will need to replace the socket.