Swap files work — but they are not a cure.
Yes, you can use a swap file on an SSD to compensate for soldered RAM — but it won’t feel like having more memory.
The operating system will page data to the SSD when RAM fills up. This keeps you from crashing when you run out of memory, but it is slow. Even a fast NVMe SSD is orders of magnitude slower than RAM. Your laptop will stutter, apps will lag, and the SSD will wear faster from constant writes.
If you are stuck with soldered RAM, a swap file on an SSD is a better safety net than nothing — but do not expect to run multiple heavy apps smoothly. Close what you are not using. Upgrade the laptop next time, and get one with socketed RAM.
