Assuming you get those ping spikes for all hosts and not just one, the first thing you should check would definitely be if it happens on ethernet as well or just on wifi.
If it's only on wifi then there might be some things you can do like switching to 5ghz if not already using it, increasing transmit power, or enabling MU-MIMO, but it will always be worse than ethernet. If you have a very old AP it might just be time for a new one.
If you get those ping spikes for all hosts while using ethernet, the problem likely lies with your router or ISP. If you have a separate modem you could try plugging your PC directly into that, skipping the router, to test if the problem persists. That will tell you for sure whether the problem is with your router or with something beyond it such as your modem or ISP.