URGENT ! Question for connecting a light barrier

It is a pnp as I found out.