How to replace a switch with a NJK-5002c hall sensor?
There is a previous post about these here at this thread. 

If you look at the "overview" section of the item on Newegg, it describes it as:


Detection method: Inductive
Switch frequency: 320kHz
Detective distance: 10mm
Model: NJK-5002C
Working voltage: DC6-36V
Output format: 3-wire NPN normally open 


So the black wire is an NPN collector output, which means it switches from open (not connected to anything) to ground (connected to the blue wire.) 

If the previous switch output is switching some wire to ground (call it the red wire), then it's a direct replacement: black to red.

If the previous switch output is switching the red wire between two voltages, such as ground and +5v, then do the same as previous, but tie a 10k-1k resistor from black to the +5v power rail. This will "pull-up" the volts to +5v while not activated.

You may find that this new sensor outputs the inverse of the previous switch (functions backwards.) If that's the case, you can either get a different sensor with the inverse output, or use a variety of methods to invert the signal, such as an NPN transistor or FET. Better yet would be a comparator, as a setpoint or threshold can be specified, allowing better position control, such as figure 3 here.