Jerry Van Dyke
When Don Knotts exited the show, Jerry Van Dyke was considered to play the role of a Deputy. As such, he would have replaced Barney Fife, and moreover he even appeared in a Deputy’s uniform in a season five episode. However, Van Dyke instead opted to star in My Mother the Car, and many years later he admitted that if he could go back, he would have taken the part of the Deputy.
Police
Just to go off that last fact, when Don Knotts left the show, the show explained his disappearance by saying Barney move to Raleigh, North Carolina in order to join their Police Department.