Why?

You can set up a website without a domain name. Most hosting companies have a free tier, so you can set up a web presence for nothing. But I don’t recommend that.

For much the same reason as I don’t recommend relying on a social media platform, if you have your author presence at ‘fancypants.blogspot.com’ what do you do if you don’t want to use Blogspot any more?

Buy a domain name. They’re not too expensive, easy enough to connect to your web host, and you can keep them for life. You can change whoever hosts your website at the push of a button, and your visitors never have to know.

I recommend buying your domain name separately to your hosting. Most hosting companies will offer you a free or cheap domain for the first year, which admittedly will often be cheaper. But after that first year, they can charge whatever they like for a renewal. You can technically move your domain to another registrar, of course, but that’s a hassle, and runs the risk of your site being down for a while during the transition.

Keep them separate, and you keep the control.