How to execute certain code on back-end button press?

How to execute certain code on back-end button press?