The derailleur often has a hard time shifting to the smallest cogs because that's where its return spring is weakest.
Any excess friction in the shift cable or damage to housings will cause the symptom you describe; you should remove the cable to check its condition and straighten any kinks in it, and ensure the housings are in good shape and the right length to minimise bends (the RD loop should have at least a 2" radius). Check housing ends for strands poking through ferrules and cut, file or grind the end straight if need be. If that doesn't sort it, try fresh cables and housings.
It may also be worth checking your derailleur hanger is straight if nothing you do fixes it.