Every copy of Red Alert 2 shipped with its own unique install key, printed on the disc case or in the manual. That is the code the installer is asking for, so start by digging out the physical packaging if you still have it.
If the disc is second-hand without the case, the seller may have the key, and it is worth asking before anything else.
What to avoid is a key generator. Beyond being piracy, those programs are one of the most reliable ways to end up with an infected machine, and the "caution" labels on them are not exaggeration.
Red Alert 2 is also sold digitally today, and a legitimate purchase comes with a working key and no risk.