I now have btop permanently running in a Terminal and I habitually Alt-Tab to it to watch my swap. As soon as my free memory gets less than 1 Gb I kill any Firefox tabs (the memory black hole).
I know this won't be popular, but Linux people have some kind of Stockholm Syndrome on this. They tell you all of the obscure configuration files you have to edit, the additional programs you install. They insist that just having the OS kill a random program to save the DE is a good plan. It's the typical "your holding it wrong" mantra.
I run both Windows and MacOS and have done so for decades. I cannot remember the last time I had a hard freeze like I get on Fedora. On the exact same box running Windows I was able to have VS Code, Chrome with 15+ tabs, terminals, docker, etc. all running with zero issues. On Fedora I have a handful of Terminals and Firefox with less than ten tabs and nothing else running and I have to watch btop like a hawk.
The excuses people make are mind bending, and the shifting of blame from the system onto the user is shameful.