#go to file name can vary
sudo nano /etc/netplan/01-netcfg.yaml
# edit to
network:
ethernets:
enp0s3:
dhcp4: false
addresses: [192.168.50.195/24]
gateway4: 192.168.50.254
nameservers:
addresses: [8.8.8.8]
#save
#apply with
sudo netplan apply