I have been researching about these two photoelectric hardware for a while now, but I don't seem to be understanding on how I could connect them to the arduino.
These are industrial photosensors, which are wonderful devices. They work. No futzing around with shielding ambient light, noise, amplifiers.... The problem for you is that they output whatever their supply voltage is, which is 12-24VDC. You can not put more than 5v on an Arduino input. There are some industrial devices that have "Open collector" outputs, which can work with your Arduino, somewhat directly.
However you can use a resistor divider to provide a 5v signal to the Arduino.
If 12-24VDC is available to you, use the Omron. The BGS/FGS is for Background or Foreground Suppression. Might be needed in your application. The 2-wire device you are talking about is just the light source for the Photoswitch (Allen-Bradley) units, which operate in "Through Beam" mode. If an object blocks the beam you get a signal. You would still need the receiver. Photoswitch does have some "Diffuse" mode and "Retroreflective" mode units, which are single-piece.
Thank you very much Paulcet. Your advice is really helping me figuring this out. I have lately been working on it, and I'll share it if I finish my project soon.