The three left hand gears are the front gears. These give the range: low, medium or high -- small cog is low, large is high.
The six (or nowadays often more) on the right are the rear gears. They're the other way from the front -- small cog is high, large is low.
There is usually quite a bit of overlap between the three ranges. The best way of using them on a mountain bike is to change just the rear (right hand) gears most of the time, changing the range (left hand) occasionally.
Off-road in mud, on steep banks, or cycling up a hill with a load, you'll need the low range (small front cog) -- also called "granny gears".
Cycling fast on a smooth flat road you'd use the high range. For gentle pootling on the road, or cycling on made-up cycle tracks you'd use the middle range.
As you say, when changing ranges you'll need to change the rear gears the other way -- for example, you might be in low range fourth and want to go higher. You'll change the left gears to middle range, and probably at the same time the right ones to second or so. It's much easier to do than to explain....
Generally you shouldn't use (and won't need) the lowest of the high range or the highest of the low range -- these cause the chain to wear quicker.
Just cycle in a comfortable gear, but always tend to go for faster, easy pedalling (lower gear) rather than slower, harder pedalling (high gear). This is better for your knees, and faster too.
The main thing is to remember to change gear often enough, preferably just before you need to (so change down before the hill, or before stopping). Ease off the pedalling pressure slightly when changing, but keep the pedals turning.
Oh, and remember to clean and lubricate the chain often -- it and the cogs will last longer and cycling will be easier.