My pc gets shut down before I goto sleep. It started a couple months back... I really dunno anything about this sorta thing I saw on the steam site something about certain ports needing to be opened but I haven't got a clue how to do that or if it's even needed
Depends, sometimes after a Steam update the ports go haywire and need to be relearned. I assume you're behind a router, yes? You may have to configure that, but an easier question, are you using Windows Firewall? Find that in the Security Center inside the Control Panel. If it's on, turn it off briefly and then play for a day or two. If you're not having problems anymore then it's your local firewall. If so, go to the Exceptions tab of your Windows Firewall, remove all instances of Steam.exe and then start playing a game again. Windows will ask if you want to add exceptions to the firewall, this is "port relearning" and will make all the proper associations with your ports.
If it didn't fix the issue, however, you may need to add the ports to your router's firewall/port forwarding. You need to figure out your model of router, find the login credentials, login to the router and open the following ports:
Code:
Steam Client
* UDP 27000 to 27015 inclusive (Game client traffic)
* UDP 27015 to 27030 inclusive (Typically Matchmaking and HLTV)
* TCP 27014 to 27050 inclusive (Steam downloads)
* UDP 4380
Dedicated or Listen Servers
* TCP 27015 (SRCDS Rcon port)
Steamworks P2P Networking and Steam Voice Chat
* UDP 3478 (Outbound)
* UDP 4379 (Outbound)
* UDP 4380 (Outbound)
-From Steam
Maybe a better way to check if it's your router is to unplug the network cable going from your Cable Modem (if using cable), and plug it directly into your computer. Then you'll be open to the internet with a public IP, not behind any router or firewall except your ISP's. If that works and you have no problems, it's your router and follow the steps above (or consider adding your machine as a "DMZ" machine, saves you legwork but makes you vulnerable to outside attack).
If neither of that works, consider a re-install of your Steam client. Also might try repairing game files by verifying cache integrity (Right-click the game in the Library, should be there I think).