I wish more people knew that light curtain sensors are cheaply available and easy to integrate into an e-stop for automated machinery. you can protect a 3.0m by 0.5m region against ingress for under 70€.
if you're building hobbyist CNC stuff (milling, XY tables, robot arms, etc.) without a full-coverage interlocked enclosure they're a very affordable way to save you from serious injury.
@djm search AliExpress for "light curtain sensor". thousands of options to pick from.
under the hood it's literally just a bunch of IR laser diodes on one side and a series of phototransistors in a parallel open-collector configuration on the other side, so there's not a lot to go wrong and buying unbranded is generally fine outside of a commercial context.