Why
sudo echo "something" > /path/to/protected/file.txtdoesn’t work and what to do instead.
If you are working on the command-line and you want to write output to a file, sooner or later you come up with this command: echo "output" > file.
This is called a “Redirection”. This works wonderfully and you go on your merry way.
Sometime later, you need to do the same thing with a protected file.

