In this section, We have used 192.168.100.50 as our IP.
First, you need to edit /etc/network/interfaces:
sudo vi /etc/network/interfaces
iface eth0 inet static
And then, edit resolv.conf:
sudo vi /etc/resolv.conf
You need to restart the system for the changes to take effect.