Create or edit a custom config file in /etc/sysctl.d/
sudo nano /etc/sysctl.d/99-custom.conf
Add your settings, e.g.:
net.ipv4.ip_forward = 1
vm.swappiness = 10
Apply the changes:
sudo sysctl --system
Verify:
sysctl net.ipv4.ip_forward
sysctl vm.swappiness