Hi, Before buying a part, make sure that you have identified the faulty component.
Does the computer have a case speaker (beeper)? When it used to work, at startup was it beeping?
When you start it now, do the CPU and the case fans spin? Is the PC still under warranty?