The end pin by the circle is pin 1. The pins number 1 to 8 anticlockwise from pin one. If yours has a half circle on a short end, pin 1 is on the side to the left of the half circle. All these are viewed from above.
How do I hook up my switch as shown in this diagram?
I am thinking that pins 2 and 3 are involved.
To turn off the alarm and reset the system, a (single pole double throw) switch disconnects the speaker and sends the LOW signal from the output pin 3 to the trigger pin 2. The system is now deactivated. To reactivate it, flip the switch back to the original position. The alarm will remain off until the next time that the light beam is interrupted.
You can use this board. Just put things you want to connect to each other in adjacent holes, push the lead in deep enough (or strip wire long enough, to allow it to connect to adjacent holes on the back side of the board.
Those work as well. If you don't need all 5 holes in the row to be connected, you can use a knife to isolate some of them to make additional "nodes". Your new board is similar to the board in the video I posted.
You can use IC sockets, if you don't want to risk soldering direct to the pins of an IC, or if you are just experimenting and may want to re-use it in another project.
That's more important with expensive parts, but it's always worth considering - especially if you are working with any ICs that are sensitive to static electricity.
You solder the socket in, then plug in the IC after you have finished building
It also means you can easily replace the IC if it gets damaged while you are experimenting with things and something goes wrong.
Assuming the diagram is correct, the switch common should connect to pin 3 and the normally open contact to pin 2. It looks like a slider switch so the central tag(s) is 'common' (pin 3) and connect one of the outer tags to pin 2.
Connect the middle pin of your switch to pin 3 of your chip. Connect one end pin of your switch to speaker (-) and the last pin on your switch to pin 2 of your chip.