Suppose you opened a file in the Vim editor, made a lot of changes, and then when you tried saving those changes, you got an error that made you realize that it's a root-owned file, meaning you need to have sudo privileges to save these changes.
:w !sudo tee %
The aforementioned command will ask you for root password, and then let you save the changes.