The knock sensor on a 1995 Oldsmobile 98 with a 3800 engine is typically located on the
driver's side (left) of the engine block, near the rear of the engine. It's often near the oil filter, but not always directly on it. Because its exact position can vary slightly, you'll need to consult a repair manual specific to that year and model Oldsmobile 98 with the 3800 engine. A picture in the manual would be the most helpful.
Looking at diagrams online for similar year/engine combinations might also be helpful, but remember to confirm with your specific vehicle's manual.