A couple of cyclists, returning to cycling after a long absence and riding multi-speed bikes for the first time, have asked me for help in understanding how shifting works. They could find lots of information for beginning riders about bicycle safety, which was very helpful, but not really what they were after, and technical information about gears that went right over their heads. I told them both what I had slowly figured out on my own and wished someone had told me. Since two people asked me the same question within a month, I figured maybe more people could use this information.
When I got my current bike, I really didn't know how to shift. I tried reading the manual that came with my bike, thinking that would help, but it talked about moving the chain from a smaller to a larger sprocket or shifting between larger and smaller chainrings. Huh? I didn't know what any of that stuff meant. I learned eventually, but only much later (I seem to only be capable of learning one new technical term per week). But aside from the issue of having to learn new vocabulary, I couldn't see where the chain was when I was riding the bike! What I saw was the numbers on the shifters! Why did the manual make no mention of the numbers I was looking at on my handlebars? Duh!
So this is what I figured out eventually, in the terms I thought of it. I've since learned that more experienced cyclists seem to be doing more or less the same thing I'm doing, so my trial and error method worked after all. Hopefully I can save someone some frustration.
My Bike and What I Do
My bike is a 21-speed, i.e., 3 gears in the front (left) and 7 in the rear (right). Your bike might not have the same number of gears, but this will give you the basic idea, and you can extrapolate to your setup. I think of the gears by their numbers on the shifters, 1-3 and 1-7, so that's how I will refer to them.
I don't shift the front gears that much, and I hardly ever use the lowest gear (many bikes just have two front gears. It's the lowest gear that's "missing" on the ones with just two). I use 2 and 3 almost exclusively. Within a given trip, I might not shift the front at all. I shift the rear gears constantly, though I hardly ever shift as low as 1 (I would only shift that low to go up a very steep hill, and in that case I would want the front gear to be in 1 as well). I use from 2 to 7 all the time. If I'm starting off, I start at 2 or 3. I want to be in a low gear in order to accelerate quickly. Within just a few pedal strokes, I shift up a couple gears. Then once I'm up to full speed, I shift up to 6 or 7. When I approach a light or a stop sign and I know I'm going to have to stop, I shift down in increments so I'll be in 2 or 3 again when I start again (you should only shift while you're pedaling).
Each time I shift the rear, it's not necessary to shift just one step at a time. I usually will shift in increments of two. For instance, I'll start at 2, then shift to 4, then 6, then maybe to 7. Or I'll start at 3 and shift to 5, then 7. Then downward from 7 to 5 to 3.
So how do I decide what gear to use in front? I only use 1 if I'm going up a very steep hill, and only if the rear is in a low gear. I wouldn't use that combination on flat terrain because my legs would have to go around way too fast and I wouldn't get anywhere. It's just for very steep climbs. Like I said, I use 2 or 3 most of the time. 2 means less resistance, so it's easier on your knees, but you don't go as far or as fast. 3 means more resistance, so it's harder on your knees, but you go farther for the same number of pedal strokes. In the summer I generally leave it on 3 all the time. I'm still moving along very easily, and doing all my shifting in the rear gives me plenty of versatility. I will shift down to 2 in the front to go up a moderately steep hill even in the summer (and down to 1 for a very steep hill). In the winter when I've got my studded tires on which add rolling resistance, I generally leave it on 2 all the time. If I'm riding in a strong headwind, I use 2.
If you're approaching a steep hill, shift down before you need to be in a low gear for the front. It's hard to shift the front gear when you're pedaling up a steep incline. You want to already be in the low gear before you're going up the hill. You can shift the rear down in increments, but you would want to shift down some before you shift the front down to 1. Don't shift the front down to 1 if the rear is on 7 (21 speeds is hypothetical. Some of them don't really make sense to use). Having the chain in that position would put a strain on it. You could shift the front down to 2 and the rear down to 4 (in either order), and then shift the front to 1. Then as you continue up the hill, if it gets steeper or you get tired, you can shift the rear down to 1 incrementally.
The lower numbers on the rear also mean less resistance. Remember I said I shift up to 6 or 7 when I'm at full speed? Which one depends on the road, how tired I am, the wind... On the same flat stretch of road on my commute, on most days I might normally shift up to 7. On a day when I'm a little more tired than usual, I might shift up to 6 or even only up to 5, and that will feel like the same amount of work. It's better to use a lower gear and not wear out your knees. It may be good for you to experiment with different gears and see what's comfortable at your full speed. It's common for beginning cyclists to ride in too high a gear and put unnecessary strain on their knees; try riding in a lower gear than what feels familiar for a few days and see if you like it or not.
Ultimately you just need to ride and practice, but I hope this is helpful if you're a beginner. Everyone will do things a little bit differently. Other cyclists may do more shifting in the front than I do -- I think I probably developed my minimal left-hand shifting habit because I've had problems with tendinitis in my left wrist from time to time, and excessive turning of that wrist will aggravate it. Even if you also have a 21-speed, your gears may not be exactly the same as mine. Other factors will vary as well. This is just what I do, and it works for me. It took a while to get the hang of it, but eventually it became routine.
If you want more information beyond the absolute beginner variety that I've presented here, the following are some excellent sources:
How to Climb a Hill on a Bicycle by Ken Kifer -- Ken discusses different types of hills and goes into more detail than I did here.
Cycling Cadence and Bicycle Gearing by Ken Kifer -- how gears work and why a higher cadence is better.
Everything You Wanted to Know About Shifting Your Bicycle's Gears, But Were Afraid to Ask... by Sheldon Brown -- detailed article about shifting and how derailers (AKA derailleurs) work.