Making sure edits work as intended before publishing
The more or less standard solution is to maintain a so-called staging site (i.e. a mirror of your production site, but in a protected environment), and make all changes to the staging site before committing them to the production site.

The use of a staging site is not only limited to edits, but is also very useful when making more substantial changes, such as updating a module or adding a new module.  The staging site let you run detailed tests to make sure that changes does not "break" anything before committing to the main site.

You can use drush to simplify syncing content and configuration between the staging and production site.

Edit: By "protected environment", I mean some computer that is not available to outsiders on the Internet. It is typically only available for use by yourself (and your team if you're not working alone, but manage a team of developers). The standard way of protecting it is to use a firewall and only allow connections from the IP-addresses belonging to you (and your team members)