Computer freezes when connected to the internet

Dec 12, 2018
17
0
10
I just built a new computer
CPU ryzen 7 1700x
GPU Radeon 570
Motherboard b450 tomahawk
RAM 8gb g skill ripjaws

I can install win10 and all the drivers I need, i believe, and it runs fine but as soon as I connect it to the internet and try to run anything from task manager to installing chrome it freezes. Sometimes right away and other times it can last anywere from 2 min to 4+ hours before freezing.
What may be the cause of this?
 
Malware? or Virus. I was working on a clients PC once that had a virus and was being used to send massive amounts of emails. As soon as it recognized an internet connection, it started flooding the network with these emails. I disconnected it a soon as I saw what it was doing( I ended up re-installing the OS). Comcast sent me an email the next day asking why all this email traffic was coming from me.