To quit a stuck application you may use Force Quit option on Mac but sometimes the stuck application does not accept Force Quit. So, in that case you may kill the application by using commands on Terminal.
The method written below helps you to know that how can you kill an application through command line.
How to Kill An Application Via Terminal On Mac
Step 1
Click on Finder

Go to Applications > Utilities and launch Terminal

Step 2
Type the following command and hit Enter key
top

Step 3
It shows all the processes and applications running on your Mac. In first left column under PID find your application to which you want to quit and note down its PID number

Step 4
Just press q to exit from top

Now type the following command in Terminal and press Enter key
kill 113
where 113 = application process ID

Step 5
Now, to observe the change run top command again

The application with PID number 113 is not available anymore
Great post, thanks!