Here's a Linux tip:
When you kill a process, you're not "killing" it. You're sending it a signal.
It's up to the process to decide what to do.
kill <PID> (sends SIGTERM, signal 15):
This is the "polite" way.
It sends a SIGTERM (Terminate) signal.
The process can "catch" this signal to clean up: save files, close connections, etc., then shut down gracefully.
kill -9 <PID> (sends SIGKILL, signal 9):
This is the "forceful" way.
It sends a SIGKILL signal.
This signal cannot be caught by the process. The kernel steps in and immediately terminates it.
Consider trying kill first. Only use kill -9 if the process is stuck and refuses to die.