Ping is mostly about your connection and the server you pick, but the local machine can still drag it down.
Disable Windows services you do not use, such as Alerter, ClipBook, Error Reporting, Help and Support, Indexing Service, Messenger, Network DDE, Routing and Remote Access, Secondary Logon, SSDP Discovery, Telnet, and the Wireless Zero Configurator if you are on a wired connection.
Heavy security suites slow gaming traffic noticeably, and Wi-Fi adds ping compared with a cable. If you can run an Ethernet lead to the router, that single change usually beats every tweak on the list above.
After that, choose servers geographically close to you and check that nothing else on the network is streaming or downloading.