It's good to know about pull-up and pull-down resistors, but for this project you won't need them. Instead, you can use the internal pull-ups that are on all of the mega168's digital I/O lines. These internal pull-ups can be controlled in software. As far as debouncing goes, just realize that mechanical components physically bounce over very short timescales when two parts first make contact. What this means is that the signal from your button will rapidly alternate between high and low for a little while after the button is pressed. If your code isn't careful, it might interpret this as many button presses rather than just one. The simplest way to deal with this bouncing is to insert a delay of perhaps around 10 ms after you first detect a change in the signal from the button. For example, in pseudocode:
// wait for button 1 to be pressed
while (button 1 signal is high)
;
// if we get here, button 1 has been pressed
// wait for 10 ms so the button can finish bouncing
delay(10);
// react to the button press
Ladyada's button tutorial for some reason doesn't mention the AVR's internal pull-ups and instead, in my opinion, makes things more complicated than they need to be by implying that you need an external resistor in your circuit. Actually, it implies you need two external resistors, but if you're careful not to use your input pin as an output in your code you can just connect a button or switch to ground on one side and directly to your I/O pin on the other. This can simplify things a lot.
- Ben