Random reboots was occurring on my machine

I was having random reboots occur on my machine today and yesterday ( i did some trouble shooting and reverted back to 5.15) I was on 5.19 and was wondering when random reboots occur does it mean it could hardware or software issue, because in terms of hardware my system is fine. Any tips or advice would be great if the reboot re-occurs again thanks.