Edit the file eth0 (or similar) config file,
nano /etc/network/interfaces
If your network interface isn't eth0, you can find it by checking,
ifconfig (or) ifconfig -a
If using Ubuntu, the interface name may be ens3 (You can verify this with ifconfig -a)
And then add/edit the following to the file,
auto INTERFACE
iface INTERFACE inet static
address IPv4_Address
netmask IPv4_Netmask
gateway IPv4_Gateway
iface INTERFACE inet6 static
address IPv6_Address
netmask IPv6_Netmask
gateway IPv6_Gateway
dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888
Save and exit the file.
systemctl restart networking