how do i kill a program when the user has finished using it.

i have a button exit program, which has unload me
but when i install the program on my computer and then run it, i still have the program running in the background, the only way to kill it is ctrl alt and del and then shut the program from there