Depends if you want to actually take care of your problem or not. Seafoam won't really help.
If you have gotten some bad gas, it more than likely has polymeric residue inside it and you need to thoroughly deep clean to your entire fuel system with a professional grade cleaner.
The knock and ping also indicate this gas might have its octane numbers off too. Sadly, there are dozens upon dozens of cases of gas station owners dumping water in their gas stations holding tanks to dilute the gas and make an extra buck. If that's the case, then you'll also need a fuel system cleaner that bonds to the water that's now in your fuel system.
This is the best fuel injector and fuel system cleaner to thoroughly clean your vehicle, remove any contamination and water:
https://www.protecautocare.com/motor-ve ... or-cleaner Use one can, it'll take care of your issues if they are related to the fuel. Hope this helps.