It can be a pain to go into System Preferences every time you want to hide the dock. Instead, try this:
- Hold down Command and Option keys, and then press the D key.
You should see the dock slide away. This is especially useful when you want to temporarily hide the dock for extra screen real estate.