Reflective Sensor

I know that. But I can't figure out that code that makes it work.