To determine if the light socket is defective, use a multimeter to test the incoming power to the socket. If the socket is getting power, but the light bulb won’t work, this indicates that the socket is defective and should be replaced.
To determine if the light switch is defective, use a multimeter to test the switch for continuity. If the light switch does not have continuity, replace it.
To determine if a switch is defective, use a multimeter to test the appropriate switch for continuity. There may be up to three different circuits controlling the fan, light, and heater separately. If the switch does not have continuity in the on position, replace it.