Windows

Disable Fullscreen Optimizations

Source is known to be worse with fullscreen optimizations and thus you should disable it.

Open your game folder through Steam. Then, right click on hl2.exe, click Properties, go to the Compatibility tab, and then check the box that says Disable Fullscreen Optimizations.

Use High Performance power plan

Open Power Options and select the High Performance power plan, or the Ultimate Performance plan if you have Windows 10 Pro for Workstations. For AMD Ryzen users, you may have a Ryzen specific plan. Use that.

Disable Radeon Chill

Radeon Chill is a power saving feature that introduces a variable framecap. Disable it in the Radeon Settings app:

Go to the Gaming tab, then set global settings or for Team Fortress 2 only if you want to use Chill elsewhere and finally turn Chill off.

Disable Unnecessary Services

You can use the W10Privacy tool to reduce disk load and other workloads to improve performance.

Networking optimization

Use TCP Optimizer to optimize your internet settings.

  1. Choose your connection speed with the slider at the top.
  2. Choose the optimal setting at the bottom.
  3. Click apply changes.

Driver latency optimization

Badly programmed kernel-mode device drivers might cause latency issues, which lead to problems such as frequent stuttering. The user must sniff out exactly which drivers are causing latency.
Use LatencyMon and DPC Latency Checker to analyze latency issues caused by kernel-mode device drivers. If they report issues, try updating your drivers or installing alternate drivers.
Alternatively, you can switch your (compatible) drivers to MSI mode and disable their interrupt limits, although this is for advanced users only.