Xbox One S shutting down when start playing any games

My Xbox will work for a few seconds or longer if I use apps or browser, it won’t turn off. but when i start playing any game it just make a click sound and turn off.

Did you try a new power cord? If suspect this one would be the power supply!