Assuming the limit screws are properly set, which they should be if the gears worked fine when you got the bike and no-one has faffed with them since, then the most likely problem will be cable tension.
If the chain won't move to a smaller ring/sprocket, then the cable is too tight.
If the chain won't move to a bigger ring/sprocket then the cable is too slack.
If it is struggling to do both, then it is probably a damaged/worn/corroded cable and/or outer which isn't allowing the cable to slide as intended.
To adjust cable tension in small amounts, use the barrel adjusters at the shifter end, or the derailleur end, or somewhere in between!
If it needs a bigger adjustment than the barrel adjusters will allow, then the cable clamp on the derailleur is where to go.