The beam/sensor has a relay output so you can wire it up like a [u]switch[/u].
You can wire it like the example (with a pull-down resistor) or you can reverse the relay & resistor and use the [u]internal pull-up resistor[/u].
After you've figured-out how to read the beam, you can use an [u]if-statement[/u] to turn on an LED.
Then you can add a delay() as shown in the Blink LED Example, and a [u]for-loop[/u] to blink an LED a certain number of times.
All I want to do is have a red green light on until the beam is broken then flash red for 30 seconds then retune to green.
If that's a regular-small LED you can drive it directly with the Arduino. If it's a bigger light, you'll need a relay board (with a relay and a driver) or a solid state relay, and an appropriate power source.
The Infrared Beam unit has a relay that is activated when the beam is broken. Unfortunately Jaycar uploaded the wrong user's manual on that product page but the relay probably has 3 terminals which are labeled something like NO, NC, and COM.
NC stands for Normally Closed. So this is always connected to COM unless the beam is broken.
NO stands for Normally Open. This is connected to COM when the beam is broken.
So you will want to connect a pin(say D2) on your Arduino to NO on the unit. Then connect COM to GND on your Arduino. This means when the beam is blocked digitalRead(D2) will be LOW.
Have a look at File > Examples > 02.Digital > DigitalInputPullup for a basic example of using the digital input to trigger an output. In the example the reading of D2 controls the output on D13, which on many Arduinos has a built in LED connected.
After you get that working you will just need to modify your code to run your red and green LEDs. I suggest looking at File > Examples > 02.Digital > BlinkWithoutDelay.
Now that's all pretty simple and will probably work fine but there is a more complex issue you might need to consider, although it's a bit more advanced for a beginner. It's possible when attaching an input like this to your Arduino that it can generate voltage spikes that exceed the limits of what your Arduino can handle. I haven't had any problems with the devices I have hooked up in a similar way without protection and I think the AVR microprocessors that most Arduinos are based on are pretty robust but it's a bummer to fry your Arduino. Here's a good article that talks about some of these issues: Protecting Inputs in Digital Electronics | DigiKey. Maybe someone with more knowledge will comment on how much of a concern this is in your application.
Awesome Thank you for the response. As i am new it took me a bit to work it out but have managed to hook up the beam (switch) and ran both codes for the examples. Now my next question is how do I integrate both examples into the one sketch? and where do I add the green light to come back on after it flashes? so sorry for my lack of knowledge and I really appreciate the help.
So I got the green light to stay solid until the beam is broken.
Green light goes off and red light flashes. Now how do I get the red light to flash for x amount of time. Even if beam isn't obstructed?
You don't - the idea of Blink Without Delay is that there are no calls to delay() anywhere.
I suggest you play around with the Blink Without Delay sketch for a while and see what it can do.
Please get into the habit of using code tags when posting code.