Talking about obsolence or shortness of supplies? In most cases, obsolence doesn't happen unexpectedly, the parts use to be marked as "not recommended for new designs" or have low EOL numbers. Manufacturers often suggest a replacement.
Shortness of supplies is the problem of these days. You have 52 weeks or even more lead time for many standard parts like popular uC, FPGA or analog IC.
Generally speaking, there's rarely a 100 % equivalent replacement. You need to use application specific criteria when comparing characteristics. For me, distributor component search (e.g. from mouser and digikey) is a useable way to indentify replacement parts. There are also professional service providers like SiliconExpert.com. Some major instrument manufacturers have integrated SiliconExpert with their internal component database. They offer e.g. cross reference search for parts, but still need to compare parameters manually.