Debian 12 method:

First, we have to find out the interface name.

# ip link show

The Output should look something like this:

1: lo: LOOPBACK,UP,LOWER_UP mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens18: BROADCAST,MULTICAST,UP,LOWER_UP mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:0d:d5:a2 brd ff:ff:ff:ff:ff:ff
    altname enp11s0

The device we want to edit the config for is named "ens192" in this example. Now we can go ahead and make some changes to the config file using a text editor like e.g. nano. In Debian, the config file's path is "/etc/network/interfaces"

The content of the file should look something like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug ens18
#iface ens18 inet dhcp
auto ens18
iface ens18 inet static
address YOUR_STATIC_IP
netmask YOUR_NETMASK
gateway YOUR_GATEWAY
dns-nameservers DNS_YOU_WANT_TO_USE

# Allowing IPv6 DHCP
iface ens18 inet6 dhcp

As you can see, we commented out the line containing things like "dhcp" and "allow-hotplug", and then added our own configuration. The only thing left to do now, is restarting the networking systemd service:

# systemctl restart networking

Congratulations! Your server has now a static local IP-Address. To double-check whether it has worked, you can look up your IP with:

# ip a

Debian 13 method:

First,

# apt install systemd-resolved

After that, create a textfile in "/etc/systemd/network/10-ens18.network". It needs the following contents:

[Match]
Name=ens18

[Network]
#DHCP=no
Address=192.168.15.15/24
Gateway=192.168.15.254
DNS=1.1.1.1
DNS=2606:4700:4700::1111
IPv6AcceptRA=yes

[IPv6AcceptRA]
UseDNS=yes
UseAutonomousPrefix=yes
UseRoutes=yes

Then, enable the systemd network services:

# systemctl enable systemd-networkd --now && systemctl enable systemd-resolved --now

Then, link the systemd-resolved file to "/etc/resolv.conf":

# ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

After that, check the interface status:

# networkctl status ens18

Perform a reboot. After that:

# systemctl restart systemd-networkd

Check resolvectl status:

# resolvectl status

If this times out, you can try to restart it with:

# systemctl restart systemd-resolved

At the last step, you can disable and stop the old networking service:

# systemctl disable networking --now

Finally, test if you have got the right address with "ip a".