9 out of 10 times when my computer freezes or slows to a crawl, it's the web browser. It is nice to see this.
If you are lazy you can try nohangd which is nice because it warns you with a notification before taking action.
Though the upcoming MGLRU [1] patches (tested on Android and ChromeOS) should significantly [2] improve the kernel's handling of memory and oom situations.
[0] https://fedoraproject.org/wiki/Changes/EnableSystemdOomd
[1] https://lore.kernel.org/lkml/20210313075747.3781593-1-yuzhao...