how to make a quit button in unity

Code Example - how to make a quit button in unity

                
                        //need to build to work
    public void quitGame() 
    {
        Application.Quit();
    }
                    
                
 

quit button unity

                        
                                void quitGame() {
     Application.Quit();
 }
                            
                        
 

exit button unity code

                        
                                void doExitGame() {
     Application.Quit();
 }