How does industrial application interface a switch that is several meters away
There's usually no problem.

PLC inputs typically take 5 to 10 mA (check the manual) on 24 V inputs. This is enough that EM interference is not a problem.
I'd say that 50 m would not be unusual for a button or sensor.
The PLC inputs are scanned every few milliseconds. This by itself provides some debounce filtering along with whatever filtering has been designed into the electronics of the input circuitry. Again the manual should have some information on this.
If you're paranoid and need to debounce in software it's as simple as a time delay on the input.

Pseudo-ladder logic.
   Input              +TON-------+
---| |----------------| 100 ms   |
                      +----------+
   TON.DN
---| |-------- whatever