PC powers on but no display - need advice
Hi everyone I'm new and not sure if this is the right place to post this, but I kind of need some advice on a problem I have/had. I bought an OEM computer about a year ago that recently stopped working last week. One night I turned it off to go to bed and the next morning it would no longer boot properly; I didn't do or notice anything out of the ordinary prior to this. Despite turning on, I didn't hear any beeps or anything and there's no display signal to the monitor. I switched out several cables and computers and found out the monitor was working okay.
So I decided to peek around inside and saw that all the fan/lights were running. I then followed some guides and disconnected everything but the CPU, GPU, PSU and RAM. Since the DVI ports were blocked off on my motherboard, I hooked the GPU to a monitor and the screen said "no boot disc has been detected or the boot disc has failed". I then tried randomly switching out my RAM sticks but nothing changed. Thinking that ruled out motherboard/GPU issues, I did a memory test using the HP software tool and it came up fine, ruling out RAM as well.
The strange thing was, when I tried reconnecting my hard drive, Windows gave me a loading/boot error and asked to either restart or troubleshoot advanced options. I did the former and now my computer is working again, which also ruled out the CPU.
So I guess my question is: I didn't really fix the problem, it kind of fixed itself; unfortunately I have no idea what the problem even was or if it'll come up again and I'd appreciate it if someone can give me some advice on what to do next? I'm afraid the computer will just die again in a few days or something and want to take steps to prevent that.
Thanks in advance!