URGENT ! Question for connecting a light barrier

And for PNP ?