It is relatively simple to change except for location. The wiring connector is a squeeze type where you need to pinch the sides inward to release. It just unscrews from the block and is 1/4” npt. Do not overtighten when installing or it may compromise the sensor sensitivity.
Have you checked knock sensor activity in diagnostics? Immediately after starting go to diagnostics ED17, and watch the knock counts during the time this sometimes occurs. There should be no activity while running at idle or low load. If the number is stable, rap sharply on an engine bracket, like the lifting eye on the right rear, and see if the knock counts increase as it should.