:s/foo/bar Replace the first instance of foo with bar on the current line.
:s/foo/bar
:s/foo/bar/g Replace every instance of foo with bar on the current line.
:s/foo/bar/g
:%s/foo/bar/g Replace foo with bar throughout the entire file.
:%s/foo/bar/g