If the 24V supply to the sensor has a common ground with the Arduino, then I'd use a voltage divider as Crossroads suggested. If is doesn't have a common ground or you are not sure, then use an opto isolator. Connect the input side of the opto isolator to the sensor output via a series resistor of about 2.2K, observing the correct polarity of the opto isolator. Connect the emitter pin of the opto isolator output to Ardiono ground, connect the collector pin to an Arduino input pin, and enable the internal pullup resistor on that Arduino pin.