Follow the steps below to fix computer power supply:-
1. When you switch on the computer, if the CPU LED does not light up and there is no sound of the fans starting, the mains power supply may not be reaching the power supply unit. Check if the spike guard sockets are working properly.
Also check if the power supply cable is loose on computer. If it is loose, fix or plug it properly
2. The power supply may fail to operate if the motherboard is not connected to the power supply. Check if all the connectors are plugged in properly.
3. If the computer case becomes very hot when you switch on the computer, switch it off immediately. There could be a problem with the earthing or supply voltage. This problem could damage your CPU (it will get burnt). Try to connect the computer to the output of a good quality UPS like APC. Get the earthing checked, because an earthing problem could also damage your hard disk.
4. If your computer is not kept in an air-conditioned environment and if the case heats up after the computer is on for some time, you can try to solve the problem yourself. Check if the power supply fan is functioning properly, by putting your hand behind the power supply. If there is no air circulation, the fan may not be moving. After some time, the power supply will have a lot of dust accumulated on it. You can use a fine paintbrush or a air blower to remove the dust and the fan will usually function properly.
5. If a computer is used for many hours daily, the electronic components of a power supply may fail. When a computer hangs or keyboard stops working suddenly or the computer restarts randomly, these could be a sign of a gradual power supply failure. Since power supply units are cheap, it is advisable to replace it with a new unit, preferably of higher rating.
6. A laptop should work without a battery when it is connected to the mains power supply. If it does not work, either the power supply cable is loose or there is a problem with the mains adapter.