Here's another way to "take care of swap" (once and for all):
First, you need enough RAM.
Secondly, you need to be that kind of user who is aware of how much RAM is being used.
What I did:
I DISABLED VM disk swapping using the terminal.
Easy to do.
Now, NO swapping at all.
The OS can't do it.
I've been running [first] my 2012 Mini like this, and [secondly] my 2018 Mini like this, and now my 2021 MacBook Pro 14" like this, too.
All work great and they have no RAM-related crashes.
But I close apps that don't need to be running, and I use NO Safari "tabs" at all -- not a single one.
But again, NO disk swapping -- at all, ever again!