Are you getting any errors? does it freeze or restart?
lets see if it still happens in safe mode:
right click start
choose settings
choose update & security/recovery
under advanced startup, click restart now button
choose troubleshoot
choose advanced
choose start up options
hit the restart button
choose a safe mode (it doesn't matter which) by using number associated with it.
Pc will restart and load safe mode
let pc go idle and see if you get same reaction
if it does, it could be a hardware problem
If it doesn't, its possibly a driver problem or a startup program
Try doing a clean boot - carefully read instructions and make sure NOT to disable any Microsoft service or PC won't start right =
https://support.microsoft.com/en-au/help/929135/how-to-perform-a-clean-boot-in-windows
does it happen in a clean boot?
Idle time is when Win 10 tries to do background processes. Things like build its search index, run defrag, download updates from windows store/windows update, many other things
Search cortana for Reliability History. Any red dots showing as errors here tied into when PC crashes? If so, click on one and iun the bottom panel, next to the error message, click
show technical view and copy/paste what it says in here. If it only shows "Windows was not properly shut down, that is just a reaction, not a reason. Win 10 runs a report at startup to see if PC was shutdown right time before, if it wasn't it creates that error.