pkill -9 -f firefox won't work, what can be a possible explanation?
My friend was running firefox on linux mint, and it froze and he used xkill to kill firefox. But still it shows up in htopps -aux. He tried to kill it multiple times but it didn't work. See the pictures for explanation. We had to kill power to shutdown, even systemd can't stop that process.
kill takes a process ID (i.e. a number) not a process name. Either find the right PID with ps first or use killall, although be aware that killall does exactly what it says: kills all processes matching the string it is given. If you only want to kill one of several Firefox processes that isn't what you want.
Did you literally type kill -9 firefox? Because the kill command normally takes PIDs not process names. killall takes process names, but process names are not always straightforward. Under normal circumstances firefox would exit when X/Wayland goes away though.