To buy a domain, you can go to a domain registrar like Namecheap, GoDaddy, or Dynadot. Just search for your desired domain name, and if it’s available, you can register it.
For hosting, you’ll need a web hosting provider like Hostinger, SiteGround, etc. Once you buy hosting, they’ll give you name servers that you’ll need to connect to your domain (via your registrar’s control panel).
Both steps are pretty easy once you get started!