How to create an FTP/SFTP user to manage /var/www which is owned by www-data

Do not change the owner of the website files, the problem you encountered may occur
Add your editor user to the www-data user group

sudo usermod -a -G www-data newuser

Working with user groups is in line with good practice standards

If you need help with the ftp server setup (directory permissions and restriction), you should specify which ftp server your are running.