Open System Preferences > Mouse and Keyboard, and click the "Keyboard Shortcuts" tab. You are presented with two options at the bottom of the window (in the "Full keyboard access" section): Text boxes and lists only or All controls. By default, "Text boxes and lists" should be selected, but if you want to be able to select other buttons in a window with the tab key then you need to select the "All controls" option.
Now when you encounter a dialog box (or window), just press the tab key to switch between the various buttons on the screen. If you would like to go to a previous button, use shift + tab. When you've got the button you want highlighted, press the
For more tips and tricks like these, visit the Mac 101 section on TUAW.