1. Use
FindEntityByClassname to find entities with a certain classname. Since your target entity is a button, I'm assuming the classname is "func_button" but of course I don't know the details of that entity so you'll have to find that out on your own.
2. If the button has a
targetname, you can check its "m_iName" prop so you can filter out other func_buttons or entities with the same classname as your target entity. Of course, you may have other means of checking which entity you're looking for so that's for you to figure out as well.
3a. If you want to press the button yourself, you can use
AcceptEntityInput to send the "Press" input to that button.
3b. If you want to catch the output of the button, you can use
HookSingleEntityOutput to catch the "OnPressed" output.
__________________