Question PC starts lagging after 1.5-3 hours of use

Mar 29, 2020
I got a new PC a couple of months ago. The second time i turned it on it was lagging, mouse cursor was jumping on the screen, every program i opened was lagging (3ds max, photoshop, chrome, adobe AE, windows explorer.....everything was lagging), when i plugged my headphones in there was screeching at the end of every sound that came out of them. And it just wouldn't work normally, i tried to shut it down and it stayed oh the shutting down screen for like 15 mins, so i restarted it using the button on the PC. Next time i turned it on same thing, it stopped after like 5 mins but started lagging again after 2 hours of working so i tried to restart it and it stayed on restarting screen like the shutting down screen previously, so i had to use the button on the PC again, and every time it starts lagging i have to restart it like that. So after i finished my projects i sent it for RMA and they said all components are fine, they pass the tests and they updated BIOS but the problem still exists. I use Windows 10 and since they are so adamant that hardware is fine i thought maybe it has something to do with the operating system (which they installed), although i still think something could be wrong with the hardware because i only got the paper saying components passed the tests and they could have just written that without doing any tests. Does anyone know what could be the problem? I would be very thankful since this problem has been bothering me for months and i need the PC to work properly since i have lots of projects that require 3d modeling and rendering, which takes a lot of time.

Here are the specs:
nVidia GTX 1660Ti
Ryzen R7 2700
Biostar Racing X470GTQ motherboard
HyperX Predator 16GB RAM
1TB Hard Drvie + 240GB SSD