Lets say we want to close Whatsapp. You go to Task Manager and check out the Details.
There we see that Whatsapps programm is called "Whatsapp.exe".
To kill or to close it, you run this:
taskkill /IM "whatsapp.exe" /F
You can do this with any other program, just switch out the .exe name.