How should I connect this HVAC replacement motor?
Is this  a belt drive or direct drive motor? If you look on the motor there should be a wiring schematic/diagram. If it is a direct drive, the colors  determine the shaft speed or the RPM. Usually, Black is high, Blue is medium high, Yellow is medium low, Red is low. Or Red and Yellow could be interchanged. White is the neutral. look on the motor or wiring cover plate. The unused wire is taped off  Yours is probably; black to black, blue to blue, furnace yellow to red or yellow, and white to white. Tape off the last wire. However check the wiring schematic just to be sure. If it a belt drive you will need a wiring schematic. Is the motor a single speed or multi speed? If you are not sure how to hook up the motor seek professional help.