Instead of “Start” (which will run as soon as the object is instantiated) name your function something else, “ExitButton” or something. When you choose the script, it will ask you what function to use. Pick that one.
Also, remember that you can’t quit while inside the Unity Editor, so you may want to print() or debug.log() to see that it runs when you click it.