Edit the /etc/fail2ban/jail.d/defaults-debian.conf file, and add configuration changes into the [DEFAULT] section to override.
[DEFAULT] banaction = nftables banaction_allports = nftables[type=allports] backend = systemd [sshd] enabled = true
WARNING: Do not change entries in the [sshd] section, as that would override settings specifically for the sshd service.
Reload fail2ban to enable the changes.
sudo systemctl reload fail2ban