I like to leave a dhcp server up so that when I spin up a virtual machine to tinker with it’ll grab that IP and I’ll be on my marry way.
If in the event that I want to later statically assign it (the ip) just use the following template and adjust.
network:
ethernets:
ens18:
addresses:
- 172.16.0.2/24
nameservers:
addresses:
- 172.16.0.2
- 8.8.8.8
search:
- domain.com
gateway4: 172.16.0.1
renderer: networkd
version: 2