Hi,
For this the easiest way is to get the uGui Full package from the Ecosystem and then:
on your ui Button GameObject,
1: add an Fsm
2: create a new state
3: use the action "UGui Button On Click Event"
4: plug your own event on this like "QUIT APP"
5: use "QUIT APP" as a transition from that state to another state
6: on that other state, use the action. "Application quit"
Bye,
Jean