Do you remember what happened before this problem started? Maybe you installed a new software or driver, etc?
Tbh, there's no certain way to determine if the problem is caused by hardware issue because most hardware issues are not immediately visible i.e. in need of thermal paste replacement, etc. So before we go to the hard part, might as well troubleshoot the easy part, which is software.
Also, what OS are you running? If it's Windows 10, go to Settings (Windows + I) -> System -> About, and post your OS build here. Also in the Settings, go to Update & Security -> Windows Update -> Update history, and see if there's any update to your system sometime around the date your problem started happening. Bear in mind that this is for Windows 10, for previous version of Windows, I think you could get the same info from Control Panel, but I highly doubt the older OS are getting any update nowadays.