How can i make laser switch?

iam making ball 2d puzzle game and i want to make it with lot of trap doors,lasers,enemy’s and more but i dont know how to make switch for my laser?i am begginer in scripting just started

Personally I would go through all of the basic tutorials unity offers for beginning scripters.
Link here

Now for your current system, I assume the player walks to the switch and presses that button on the bottom right.

You will see in the inspector panel for the Canvas Button it can call functions. So maybe you should give your player character a script that has a public void method that creates a Physics2D.OverlapPointAll.

Documentation on overlapPoints here

Then have it send a message to anything within that point like Activate(), Documentation here on sending messages to objects.

Don’t be too scared to look through all of the documentation, it’s fun, and a learning curve, if you have any issues, try going to the scripting documentation first, then, if that doesn’t solve your issues come here! We are always welcome to help.