If you're copying a database from development to production (or vice-versa), you'll need to change the URLs. See the Migrations section in this chapter.
Use Version Control
If you use a version control or source code management system such as Git, you'll be able to roll back your changes when (not if) you make a mistake. You can 'push' your changes with a single command and updated files will first be copied to a temporary area before being deployed simultaneously. This avoids the site ever being left in a broken state if you have a slow connection.
A good server host provides SSH access, but if your hosting provider only allows SFTP access, consider using git-ftp, so you can minimise the time it takes to update the site and the chance of forgetting to upload any new files. You'll still benefit from version control locally or if you're working with other developers.
Avoid using file editors on control panels like CPanel.
The editor is a simple HTML textarea - you get none of the code highlighting, formatting or syntax checking of an IDE or basic text editor, it might seem quicker but it's also much easier to make mistakes.
There's no version control, you don't get a list of what you changed and the only protection is your own backups (if you remembered to make any).
A significant error might break WordPress in such a way that you can no longer access the editor itself.
The theme/plugin editor is also a potential security risk: if someone gains access to an administrator account they can edit sensitive files on the server.
You can turn off file editing completely by adding this line to wp-config.php