Xbox one s repairs

I have an issue where my xbox goes to start up then powers off in different places on start up anywhere from 3 to about 7 seconds when the screen starts coming up with the xbox screen. What is a sure fire way to tell if it is my hard drive failing or some board repair that needs doing?