These inductive sensors are supposed to have transistor outputs, and therefore should traditionally be hooked up in a different way than i'm showing in the video. However, the internal circuitry of these sensors is set up in a way that would damage our electronics if connected like that, so using the voltage divider is the better choice in the end. So for 12V, using a pair of identical 10k (or 15k) resistors instead of one 10k and one 15k should give voltages closer to 5V (check with a multimeter), but the mentioned 10k and 15k combo works well, too. 8.1k and 22k for 24V.
Prusa-Style, smaller sensor that will work without the resistors [5V, 🌐] http://s.click.aliexpress.com/e/qBmM3ny Simply connect the sensor output directly to the input and supply the sensor from 5V, for example from the endstop or servo pins!