other times fans keep spinning and after 15 mins(takes less or more time too sometimes its just keep spinning no beep forever) it beeps and boots up
it maybe the hard drive or other hardware has problem.
May try disconnect the HDD/SDD and all RAM, and use the onboard iGPU if the PC has one, boot the PC to see what happens. Usually if the cpu/MB are fine the PC will boot, but you will get no RAM no boot device error.
Also if you have the multimeter, and use it to check the PSU. If you don't have one, and when you can boot the pc, then check the +3.3V, +5V, and +12V in the BIOS hardware monitor section, or download and install HWiNFO64 ( run the sensors only)
https://www.hwinfo.com/download.php You want to see those voltage are within +/- 5%. otherwise the PSU is bad.