A Name Servers is an address of server who record the ip address for route to the true website server location are useful for connecting specific URLs when user enter on web browser.
How a Name Server do?
When user enter a website address in browser and hit Enter, the browser starts a process looking for the real ip address of website location by routing to The name server for that website is record on Domain Registar if it found Name Server server address then the Name servers is start to translate the domain name into an IP address, and connecting the information for next step
see this diagram

How to Set Up Name Servers
Your domain registrar provides is a default name server . However, you can choose to set up your own custom name servers or point your domain to name servers with a web hosting provider, and doing both is easy.