Large file transfers from a HDD to a 4TB samsung evo 870 cause it to overheat and causes the system to not recognize it anymore, until I restart.

I have looked for multiple solutions but have not found any. Could anyone please help me with this?