If you are not confident and certain of your competence in opening up the machine and changing the PSU or not sure what type, size and rating would be appropriate then the new machine route should be preferred.
If the machine is sound, suits your requirements and, as others have commented, has not lost any components when the PSU failed, I would replace the PSU (and have done in the past)
The machine software and cabling is already set up with what I want where I want it and the PC hardware is compatible with other hardware I won't be changing.
Unless I am buying an up-market or bespoke new machine then the replacement PSU will be better than one in a new PC as, when compared to low-end PSUs, I can select one that has more power rails, neater cabling is quieter and more energy efficient (lower energy costs over time and produces less heat (good for me and the PC)). Anecdotally the machines seem more resistant to brown-outs and very brief power interruptions.