I had to fix a Samsung TV remote, as the IR LED was shot. I ended up swapping it with one from a remote for an air conditioner.
As the LEDs were extracted from a PCB, the legs had already been cut and so it wasn’t possible to determine the anode and cathode by the length of the legs.
So, another method is required. The anode (+) lead is the lead which goes to the smallest stub within the LED “bulb” case, as can be seen in the images below.
The PCB is the Samsung remote, with the dead LED removed.
The LED on the left is the dead LED from the Samsung TV remote.
The LED on the right is from the air conditioner remote and is reversed (- +). The legs had to be bent back 180° and the LED flipped over to fit.