Hi, thank you for contacting JustAnswer.com. My name is Russell. I will do my best to provide the right answer to your question.
That sounds very much, what with the clicking if you don't unplug, and the booting up if you unplug the power cord to 'rest reset' the computer... it sounds very much as if you have either a defective power supply in the desktop computer, or else (hopefully not) a shorted component somewhere else in the computer.
The power supply, inside the desktop computer, is a 'box' that can usually be fairly easily replaced as a unit. As for a short inside the computer somewhere, looking it over with the cover off, and assessing whether
1. there might be a loose wire, or metal debris, in the computer anywhere... incl. staples, and paper-clips as well as wire.
2. or, there might be a burnt smell, or an obviously heated-up or burnt-looking component anywhere.
If the computer interior is dusty, taking the computer box outside, and blowing the dust away with a forced-air compressor, would be ideal treatment. Computer interiors that are dusty should not be touched much if at all to avoid damage, so forced-air cleaning is rather necessary.