The first step in protecting your internet privacy is to ensure that any webpages that you visit use SSL/TLS encryption. Modern browsers will typically let you know if you are using a secure connection by showing a lock and the address will begin with https:// instead of just http://. You can also use browser extensions that will attempt to only use secure HTTPS connections with websites such as The Electronic Frontier Foundation's Https Everywhere.
Using a secure connection will not prevent your internet service provider (ISP) from being able to view which websites you visit, but it will prevent them from being able to see what you were doing on that website and which pages on the site you visited. For example, by using https://www.youtube.com your ISP could see that you went to YouTube, but they would not know which videos you watched.
A DNS Server is a directory of the internet. When you type in a web address, like https://www.google.com/maps, your browser sends a request to it's designated DNS Server and asks for the IP address associated with the domain name, in this case just the www.google.com part of the address. The browser will then take that IP address and send a request to the web server associated with that IP address and ask it to send you the specific web page, in this case /maps.
Typically when you use the internet, your computer, phone or web enabled device, will use the DNS servers associated with your ISP. This is the simplest way for them to collect basic information about which domains you visit while online. Less scrupulous ISPs can even alter your request and send you to the wrong page. For example you may attempt to perform a web search using google, but instead your search is directed to an affialate of the ISP who provides results that are paid for by advertisers.
However, you can protect yourself by changing the default DNS servers used by your device to public ones that do not store your information and sell it
off to the highest bidder. You have a selection of Public DNS servers that will protect your privacy. Google offers a free public DNS server that does not alter your traffic in anyway and
does not store or sell any of your personally identifiable information.
Read More about Google Public DNS
The above solutions provide a good bit of protection, but they do not completely prevent your ISP from spying on you and selling your data. A VPN lets you create an encrypted tunnel between your computer and the internet. Your ISP will be able to see that you are connecting to the VPN, but they will not be able to track where you go or what you do while you are connected to the VPN. Additionally a VPN can be used to protect all of your internet traffic, not just web browsing. Using a reputable paid VPN service that does not keep logs and does not sell your information is the most comprehensive protection that is readily available to protect your privacy from your ISP.