This wp-config.php file can be used in multiple environments (local, staging, production). It works by detecting the server hostname and defining different constants depending on which hostname is used.
WP Local Toolbox plugin is recommended: https://wordpress.org/plugins/wp-local-toolbox/