Let's say you want to use cloudflare, or another CDN. The process is pretty simple.
You setup your website and preferably DON'T have it talk to anyone other than the CDN.
You then point your DNS to wherever the CDN tells you to. (Or let them take over DNS. Depends on the provider.)
The CDN then will fetch data from your site and cache it, as needed.
Your site is the "origin", in CDN speak.
If Cloudflare can move the origin within their network, there is huge cost savings and reliability increases there. This is game changing stuff. Do not under estimate it.