@dino1 It depends what type it is NPN or PNP.
Then you have to check the Voltage of the sensor. Usualy they are 6 to 24 volts.
So for NPN you wire GND and Signal to Duet's probe conector and VIN to 24 Volt on duet.
For PNP you add some resistors as per wiki