The proximity sensor was a sensor device that determined how close another object was.
A proximity alarm warned Cadet Jean Hajar of an impending collision with Cadet Joshua Albert's training craft, allowing herself and most of her Nova Squadron teammates who were flying in tight formation to initiate their emergency transporters before their ships were destroyed in the ensuing pileup. (TNG: "The First Duty")
Lieutenant Jadzia Dax had to repair the proximity systems on an abandoned, decrepit Bajoran raider hidden in an underground cavern so that she and Major Kira Nerys did not end up "bouncing off the walls". (DS9: "The Siege")
Proximity sensors are commonly used on mines, where they trigger the mine's detonation when it nears or impacts a target. A malfunction in a proximity sensor could cause the mine either to detonate prematurely or to not detonate at all. (DS9: "Call to Arms"; ENT: "Minefield")