How do I adjust my rear derailleur (Shimano SIS) when it is only slightly out?
Adjusting the rear derailleur is a matter of tightening or slackening the shifter cable so that the chain runs smoothly for all rear cogs. The easiest way to do this is using a barrel adjuster -- there's normally one where the cable runs into the derailleur and you may have another where the cable runs into the shifter or on the downtube for a road bike.
If you look at the barrel adjuster from the point of view of the cable housing (not the bare cable) running into it, turning the adjuster clockwise will slacken the cable and counter-clockwise will tighten it. Adding slack to the rear derailleur should adjust the chain towards the small cog, tightening moves it towards the large cog. If the barrel adjuster doesn't give you enough range, then you'll have to adjust the slack where the cable clamps into the derailleur.
With your bike in a stand, or flipped upside-down, change to your middle chainring (for a triple) and try it out. You should be able to see small movements in the derailleur as you tweak the barrel adjuster. I like to get the middle cog dialed in really well (change gears in/out this cog) and then check that this setup works for all of the others. You'll probably have to adjust this slightly once you ride the bike. (Once you get comfortable with this, you can actually tweak the derailleur mid-ride without stopping if you have a barrel adjuster on the shifter or down tube)
After tweaking the derailleur setup, you should also double-check the limit screws just to be on the safe side. These are two screws on the derailleur that adjust how far it can move. One keeps the chain from going past the large cog (sometimes marked L?) and the other does the same for the small cog (H?). Make sure that the derailleur cannot move the chain off of the end cogs. Turning the appropriate screw clockwise should push the limit in towards the center of the cassette, counter-clockwise normally gives the derailleur more freedom.
Of course, there are a whole range of other problems that can affect shifting (worn chain, worn cogs, bad chain line, worn cable/housing, sticky derailleur, etc.), but try this first.