This is a way over simplification from somebody who is not an expert. But when did that ever stop me before.
1. When you are in the lowest geared inner chainring on the front, your bike will ride the best and your chain will be closest to being in a straight line when you use the lower two thirds or so of available gears on the rear. Those are the big cogs closest to the wheel.
2. When you are riding on the middle chainring in the front, you can safely use all the gears on the back, but it will do best if you stay out of lowest and highest gears.
3. When you are on the highest gears in the front (large chainring) you're best served in the higher gears (smaller cogs) on the back.
It's good to have the chain run in as close to a straight line as possible. Less friction and less stress on the chain and the gears both. Use both shifters to do that, you and I will both have to work pretty hard to wear out derailleurs from over shifting.
It's a lot easier to shift when there is not major force involved in the drive train. In other words, anticipate your gear changes and change when it's still relatively easy pedaling. When you're going up that hill and mashing the pedals hard and try to shift, things might not go quite as quickly or easily as planned.
That's about all I know. And it didn't take long to tell it either did it?
__________________
It's all downhill from here. Except the parts that are uphill.