How to exit Vim when :quit doesn’t work?

Yeah, same here. I made the full switch to Linux about 3 years ago, and getting stuck in Vim was a rite of passage. Just to add one more thing to Toby’s point: if you’re ever unsure which mode you’re in, hit Esc twice just to reset back to normal mode. Then try typing :q or :q!. And if things still go sideways, Ctrl + C followed by :q! can help break you out and exit Vim. That combo has saved me more times than I can count.