If you're building WordPress sites seriously, you need a staging site.
In a staging site, you can test your changes without risking your live site. It's an exact copy of your live site, which is great.
Some hosts, like GoDaddy, have a staging server feature available with the hosting plan. This is the best choice, since building your own staging server can be complicated.
The staging site needs to be synced with the live site. Then the changes can be made on the staging site.
Once the changes are tested and everything is confirmed to be OK, the changes can be pushed to the live site.
For those without a hosting feature like that, you can restore a backup (using a different database) in a subfolder or another location. This is more labor intensive, but it's worth the effort whenever you have risky changes that need to be made.
Watch the video below for a detailed explanation on WordPress staging sites.
If you like what you see in this video, there’s a complete WordPress Beginner tutorial class, available for free on YouTube.