What kind of shifters do you have? There are lots. I could use more specific language (e. g. pull, twist, thumb push, finger pull, etc.) if I knew.
Try this: Look down at your chain and gears while riding. Do it in a safe place at first - you don't want to run into a truck or off the road while you're looking down. But if you can safely look down you'll notice that the big gear in back is nearest to the frame, while it's the opposite in front - the smallest gear (chainring) is nearest the frame. There's kind of an opposite relationship between the front and back. In front your lever pulls on the shifter cable to go higher. In back you pull to go lower.
Okay, ignore that last bit for a second; come back to it later. If you pull on the right hand shifter cable (back) all the way, and ease tension on the left (front), your chain should move so that it's closest to the frame in both front and back. This is your lowest gear. Use it for climbing the steepest hills, or taking it a little easier on less-steep hills.
Now pull on the left (front) shifter and ease tension on the right (rear.) When the chain moves until it's as far as possible in both front and back you're in your highest gear. Use this for pedaling on level ground with a good tailwind, or down a slight incline, or down a steeper incline until you can't pedal any faster.
As you shift in general cycling, think of where the chain is. If you want a lower gear, move it closer to the frame, and move it away from the frame for higher gears. You usually don't move it all the way at once. You usually move it a step at a time. Sometimes you move the front derailleur; sometimes the back.
If you have it closest to the frame in front and furthest away in back, or vice versa, this is called "cross-chaining". It usually causes some clicking because the chain doesn't line up with the derailleur cage in front as well and there's some rubbing. I've heard that this causes things to wear out faster and is to be avoided. Personally, I think it will take a long time to add any significant wear. I think the reason to avoid cross-chaining is to avoid the annoying noise. I confess that after decades of familiarity with shifting I still occasionally space out, then look down and find out I'm cross-chained (usually when I'm listening to music and can't hear the noise.)
I've taught both my kids to shift. When they were learning they seemed to avoid shifting and try and stay in one gear as long as possible. I tried yelling, "Shifting" every time I shifted. They were amazed at how often I changed gears. You may be like them? In order to have the most efficient cadence and torque load on your legs you need to be in the right gear. Every time the incline of the road changes, even the tiniest bit, or the wind changes, it could necessitate a change. I'd guess I shift on average every 10-20 seconds? (Just a wild guess, but I shift a lot. Sometimes I won't be sure if I'm in the right gear so I'll shift, discover the prior gear was better, and shift back.)
When I was young I tended to favor a higher gear. Maybe it's a young-man trait, because my 21-year-old son does the same thing. I liked to push the higher gear and feel the burn in my legs. Now I'm old and have to worry about my knees, so a higher cadence with less torque makes sense. Plus, I discovered that I rode faster with a higher cadence.
There are two factors I use to determine what gear feels right - cadence and torque (the amount of force I have to exert to push the pedals and turn the crank.) Like I say, I've found that I go faster with a higher cadence, but there's a point where you start feeling like a hamster in a wheel and you actually get more tired from spinning so fast. So I find a fast cadence that I can maintain. The amount of torque I can apply depends on what kind of shape I'm in. I've been riding some of the same training routes for years. I know what gears I typically choose for each section - particularly the hills. After I've gotten myself in pretty good shape I find myself able to choose a gear or two higher for the same hills. However, I still avoid overtorquing my knees. Knee troubles are a big problem.
On my bikes, shifting the front (left hand) has more effect than shifting the rear. Sometimes when I shift the front it's too big of a jump, so I have to shift the back the opposite way to counteract the large jump and make it less. This is easy because of the opposite relationship. If you pull on the front to go higher you also pull on the back, but to go lower. They're opposite, remember?
I hope this helps. Feel free to ask for clarification. Shifting can be arcane, especially if you try and use numbers. 1st gear, 2nd gear, etc. doesn't make sense. You can try and say something like "6th in the back and 2nd in front" but that's clunky. Try looking down at the chain and seeing what it's doing. It will help understand what's going on - you have to pull the shifter to get to a bigger gear, and release some tension to go to a smaller.
Good luck! Having a wide range of gears available makes cycling so much easier, if you understand how they work. Have fun!