When you are creating a new website but don't want to make it live yet, it is possible to test your website locally. This can be done by making a (temporary) adjustment in the hosts file on your computer.
This adjustment directs the domain name you entered to a specific IP address, instead of the IP address determined by DNS.
Here's how you can do this on a Mac:
Open Terminal (via Spotlight).
Enter the code sudo nano /etc/hosts and press Enter.
Enter your password and press Enter (it's normal that no characters appear on your screen).
Then the host database will open.
Enter the IP address and your domain name as follows:
Save the file using the keyboard shortcut Control + X.
Then press Y, followed by Enter.