Recently my computer has been acting strange. It starts for 2-3 seconds, shuts off, then starts again, but successfully boots. This seems to happen after a cold boot.
Nobody can say if you do not provide hard numbers. Other will blame the usual irrelevant suspects including temperature, surges, or a mystery gremlin in the PSU. A power controller determines whether your computer powers on or off. Only way to determine what the inputs to that controller are saying or if the controller is defective means numbers from a tool sold in Kmart or stores that also sell hammers. You must have that digital multimeter. And ask how to perform the full one minute of labor to have numbers from six wires. Then the next reply can identify or exonerate the so many reasons.
No numbers means your every reply will only be speculation. And will want you to fix things without first learning what is defective.