When was the last time you cleaned your bike. There may be junk built up on the BB/cable guide/under the BB. Or lack of cable lubrication. Cable tension may be the culprit or the R/D hanger may be bent. The cable may need to be replaced.
There are several issues that may cause your shifting not to function properly.