Provided you are able to connect to the internet with your browser it is probably your firewall that blocks the sims 4 from going online. You need to unblock it.
It depends on the Firewall you use. If it is Windows own Firewall ask in a Windows forum. But most likely it is a firewall that came with your AV. In that case check their support forum.