If you want to purchase a domain, you can easily do so at a provider of your choice (e.g. web.com). For this, you must check in the first step whether your desired domain is still available. If this is the case, you can place the domain in the shopping cart like a product, buy and pay. In most cases, you can also book a hosting package or website builder, so that you have a complete package to launch your website.
If your desired domain is already taken, available alternatives will be suggested to you, from which you can then choose your favorite. Or you can check another domain for availability.
Similar to a phone number, a domain can't be bought in the literal sense, you just register it for a monthly/annual fee and get the exclusive right to use it.