https://startyourownisp.com/
There is a user on here who created/is creating a website that answers that, just in the context of starting a wireless ISP.
But, to answer your question, you would buy a connection to the internet from a provider like Level 3, or Hurricane Electric or whoever.