On a 2002 Chevy Silverado with the 4.8L engine, the knock sensor is located on the
passenger side of the engine block, near the front. It's usually mounted relatively low on the block. You'll likely need to look underneath the engine to see it clearly. It's a small, threaded sensor.
Because of the location and potential for oil and grime obscuring it, a good shop manual or a detailed online image search for "2002 Chevy Silverado 4.8L knock sensor location" is highly recommended to pinpoint its exact position on your specific vehicle before you start searching.