Many people build their websites live. That is, they set up a domain name, get it hosted, install WordPress and a WordPress theme (if using those), and get to work.
New websites rarely have an audience anyway so having your ongoing drafts viewable as you go isn’t really an issue.
But what if you are redesigning and rewriting an existing site. You probably don’t want your site visitors to see all that construction in progress. So you can maintain your current site as is and build your new site behind the scenes on a sub-domain. And setting that up is easy.
You will go to the C-panel on your hosting company’s website. I use Bluehost but all hosting companies with a C-panel should be similar. Click on ‘domains’ then ‘sub-domains.’ It will then allow you to name your sub-domain, which will be a prefix of your site. So the sub-domain name will look like this: testing.yoursitename.com. Or perhaps staging.yoursitename.com. You decide what you want the sub-domain name to be. It will also ask you to name the Home folder. If you don’t name it, it will give it the same name as the sub-domain, which is what you want anyway so you can leave it blank.
Hit ‘create.’ That’s it. Your sub-domain is set-up. Now you will just install WordPress and a theme, and begin building your site as if it were your main site.