Computers fail, it happens, and not just occasionally. While the offending component of a typical desktop is meant to be swapped out, doing it yourself will usually result in you replacing more parts than you need to. This is because diagnosing a problem is the difficult bit. With nearly 30 years doing just that, I can at least assure you that I will be able to isolate what gave up cooperating. Once you know what needs replacing you are in a better position to decide what path you will now take.
Laptops and notebooks are likewise all fixable, however they don’t play by the same rules and need an expert both to get to the parts and then find a replacement and fit it. This is usually not worth it. If you have a laptop that has just died, call for a free no-obligation chat, at least you’ll know whether you should repair or replace.