first the « material » things : fans, dirt, temperature, thermal paste, all these sorts of things.
If everything looks ok on this side, look system side for :
⋅ ram & cpu usage ( system-monitor, htop )
⋅ any hardware error ( dmesg )
⋅ state of your storage ( df -Th, df -i )
⋅ up-to-date system ( sudo apt update, sudo apt full-upgrade )
⋅ any scenario to reproduce the issue…
No crystal ball here so may you provide some info about your UB version and hardware ?