A published site has an address the host gave it — something.netlify.app, something.vercel.app. Your own name goes on top of that, on the project's Domain tab, once the site has been published.
Connecting a name you own
Type the name. The app works out who runs its DNS — which registrar or DNS service holds the records — rather than asking you, and opens that company's own page where records are edited. Beside it, the app shows the exact records to add: the values, and nothing else to decide.
Then it waits, checking on its own every so often, until the records have spread across the internet. There is no button to sit and press; the tab says "connected" when it is. A record that is there but wrong is shown as wrong, with what it currently says, so you can see the difference.
Both the bare name and www are set up. On Vercel, the host may also ask for a one-time ownership record; the app shows that in the same list and completes the check through Vercel when it is in place.
Buying a name
For a project on Vercel, the app can buy the name there: it searches, shows the price, and takes the owner's details on a form that fills from your contact card. A name bought this way is on Vercel's nameservers already, so there is nothing to copy and nothing to wait for. It is your Vercel account and your card; the app never holds anybody's domain.
Removing a name
Removing a domain from the project takes it off the site at the host. The records at your registrar are yours and are left alone; the app says so.
For the longer version, with what each kind of record is for, see the custom domain guide.