How to quit from my program

I want to create a button in my program that if user hits it will close that application . Is there anything like quit() or exit()?
Thanks