Debounce is for switches that mechanically bounce the contacts when the switch is actuated. Debounce can be done in software or hardware (cap across the switch). There are methods for conditioning the signals from other sensors depending on the type of output from the sensor. For analog signals you can use filtering or averaging to get more stable readings. For signals from an optical pickup, you can put them through a Schmitt trigger to get clean pulses with good rise times. Good wiring practices can prevent noise pickup. Keep signal wires away from power wires, keep wires as short as possible, use lots of decoupling caps, ect.