Codes po332 and po

Hi I have 2001 grand prix it’s showing code po332 knock sensor bank 2 and also code I think po020 ? Mass airflow sensor service engine light is on does that mean that both these sensors are bad and need to be replaced ? Not sure if I should just assume they are bad and have them fixed or is there other less expensive ways to approach the issue . Service engine light came on and I checked with reader and those are two codes that are showing. I here that knock sensor can be an expensive repair so just wanna hear what some car guys think. Thanks

Take the vehicule to an independant mechanic ASAP and let them deal with it.

How does the car drive? Any unusual engine noises? Fuel mileage still OK?

If it runs OK, I’d just drive it and save for my next car (which you should be doing anyway).