When I say "don't work", I mean nothing. Not even the indicators flashing 9 times.
Sometimes both keys will be temperamental but both will either not work at all or work OK.
Firstly, check that both key batteries are OK by fitting new ones (not cheap crap).
Check that the car battery is OK (don't just assume, get it tested).
If you are parked somewhere new, it could be local RF interference.
If everything is OK but the keys are playing silly games, try this.
Pull off the gear knob.
Don't press the button as you are doing this.