If you have an SSD hard disk, and enough RAM, it's a good idea to install zram as it can reduce writing to the SSD.
The zramswap package in Arch Linux provides an automated script to set up a swap with a higher priority and a default size of 20% of the size of your system's RAM. To do this automatically at each boot, enable zramswap.service.
yay -S zramswap
sudo systemctl enable zramswap.service
sudo systemctl start zramswap.service