How would one go about connecting an LED or a sensor to a printed circuit board? You could use a male header pin and a dupont cable, but that seems like it would easily be able to slip out. Is there any standard solution to this problem? Soldering is out of the question because anyone should be able to connect the wire without having to have any special skill.
There are lots of existing solutions. A latching connector for instance.
If you're trying to keep it really cheap you can just add two mounting holes near the cable attachment, this way you can zip-tie the cable to the board.
Unless the device is subjected to excessive amounts of shock, dupont cable on a 5.88mm male header pin is very reliable. If even higher reliability is required, adding more connections than strictly required will increase the extraction force proportionally. Note that the cable should be secured against either the board or the chassis in order to prevent any slack from swinging around regardless.