Just looked on interweb and its look like this problem is mostly on client side, not server.
Probably your router or your network is problem.
Try running TF2 on diffrent computer in your network (borrow some laptop or PC), to check if is not hardware problem. If problem exist on different computer, then is your network.
Check with some sort of internet speed test website in your contry, if you can get declarated speed (faulty router will give less speed declarated by your service provider).
Easiest to do:
Just unplug your modem/router for 10-30 seconds then plug them back in [to reset it to default]. Ensure that you aren't using a torrent program or anything else that could slow the internet down, and reset steam. Also disconnect any other devices from your network like tv, phone, other PC, to see if it help.
if doesnt work, you can try:
-Verify Integrity of TeamFortress 2 or reinstall TF2
When the latest Windows update is ready for your device, it will be available to download from the Windows Update page in Settings.
-Some guy on steam forums: "ive got it! what we did is i went to library, right-clicked tf2, propertys, then set launch options and i put in +clientport 27006-27014, this changes the port range just do it on one of the computers."
-Also: "Try lowering your server pings (steam settings -> in-game, -> in-game server browser: max pings / minute) to the lowest value (250) and see if that helps. Your server browser will take a few extra seconds to populate itself, but I haven't run into the can't connect to valve server problem since".