To replace pump shaft bearings, the pump needs to be disconnected from the power source and drained of any fluids. The pump housing is then opened, and the old bearings are carefully removed from the shaft. The new bearings are then installed onto the shaft, ensuring proper alignment and lubrication. Finally, the pump housing is closed, and the pump is reconnected to the power source.