Easiest and fastest way to event a pushed switch?

Hello everyone, was wondering: what's the fastest and easiest way to event a button on the floor which when an event or a player does have same coordinates then it changes to pressed mode and goes back to unpressed if the event or player leave?
I can easily check it with variables for player x and y, but what about events? And what about randomly generated events?

Let's say I have a room with 2 button switches. I randomly spawn 3 balls and the puzzle is to put 2 of those balls on the switches. The switches can also be pressed by the player itself.
Check out this blog post! 😀

EDIT: Oops, that's not the same tutorial I was thinking of but that looks good too.
Here's a video tutorial that I used to learn push events; it also includes a switch option:
unfortunately this doesn't solve my problem: I have multiple events that can press the switch, I can't do it manually...
Ahh, sorry about that. I was hoping that would get you started. I wonder if you could use a Conditional Branch with a Region ID to trigger your switches.

Original thread: https://forums.rpgmakerweb.com/threads/easiest-and-fastest-way-to-event-a-pushed-switch.140656/