When buying a domain name you have one of the following options.
Domain name providers
You can buy a domain name from domain name providers and then connect it to your web hosting.
Some domain name providers may also sell web hosting, but it is not their main business and that is why I recommend buying only domain names from these providers.
If you are planning to create your website using a web builder, online store builder, or all-in-one solution then buying a domain name separately may be an option (unless you get a free domain with your plan).
Read:
Web hosting companies
You can buy domain names also from web hosting companies and it can be handy.
Some web hosting plans may include a free domain name for a year when you get their web hosting plan.
Read:
Web hosting companies
Web hosting plans with the FREE domain included for a year