2002 Nissan Xterra - Knock Sensor Went Bad

I have a faulty knock senser is it dangerous to my engine if not replaced.

It can hurt your engine, yes. That is why the check engine light is on.