The old way (isearch, query and replace, occur and keyboard-macros)

If you are new to Emacs and want to learn more about isearch I highly recommend this nice tutorial by Bastien Guerry.

To start a classic search and replace session in Emacs jump back to the beginning of the buffer with M-< and start a query replace with M-% or C-M-% (regex version) or the non-interactive versions M-x replace-string and M-x replace-regexp .

The most useful keys inside a query replace sessions are SPC to replace and move to next match, n to skip a match, ! to replace all remaining matches in the currrent file, Y to replace all matches in all upcoming files, N to skip the rest of matches in current the file.

If you ever want to repeat a replace command with slightly different input try C-x ESC ESC to get the last minibuffer command as an Elisp expression, although using the minibuffer history using M-p or M-n is usually enough.

Another neat thing about query replace in Emacs, which you will not find in other Editors, is that you are allowed to use Elisp on the matched groups of the regex. For example you could use this to replace matches for "movie" with "film" and matches for "movies" with "films" using the search term movie\(s\)? and \,(if \1 "films" "film") as the replacement expression. Another common use case is to transform numbers in the matches using the format function.

If you are in the middle of a search and want to replace the used search term in the whole buffer, there is one more built-in method I would like to describe here. Namely you can invoke occur (with your current search term) using M-s o . This will give you a complete listing of the matched lines. Now jump to the first match and start recording a keyboard macro with F3 or C-x ( , after editing the match to your liking jump to the next match with M-g n . Finally stop the recording of the macro with F4 or C-x ) .

This will allow you to execute the macro with C-x e or F4 . To execute until you reach the end of the buffer. You can use a zero prefix argument C-0 C-x e to repeat your edits on all the matches found.

Update: As hmelman points out you can use e in occur buffers to enter occur-edit-mode and after editing commit the changes with C-c C-c . This even works for multi-occur !