Chosen Solution

I am trying to fix an xbox one x and it blinks once then turns off. I am guessing it’s a power supply failure. But if the power supply is bad, should I replace the hard drive with it?

Unless the hard drive has been damaged, there is no need to replace it as well. A way to test if the fault is within the power supply would be to connect a spare 2.5” drive to the Xbox and see if it boots. If it does, the fault is with the drive, if it still flashes and turns of replace the power supply.