Best way to detect an object presence

What's your budget?
The VL53L0x and VL6180X reflective time of flight sensors aren't cheap by hobby standards, but they'll do the job.