Does it stay on for a while then flicker first before it turns off? That's usually the bulb. Swap from the other light to check.
The switch can also go faulty. The internals carbon up and lose conductivity. Fairly easy to strip and clean up.
As morty says, the parts from one light can easily be swapped to the other to check. Just make sure you run the light for a while as the fault can re appear after a while.